Browse Source

Fix for ticket #570: Interactive prompting is always active.

Control prompting with variable "interactive" and stop setting it by default.
Add code in main.c to set it for an interactve session.
pre-master-46
Giles Atkinson 4 years ago
committed by Holger Vogt
parent
commit
23e9df0181
  1. 3
      src/frontend/control.c
  2. 7
      src/main.c
  3. 1
      src/spinit.in

3
src/frontend/control.c

@ -227,7 +227,8 @@ docommand(wordlist *wlist)
{
int nargs = wl_length(wlist->wl_next);
if (nargs < command->co_minargs) {
if (command->co_argfn) {
if (command->co_argfn &&
cp_getvar("interactive", CP_BOOL, NULL, 0)) {
command->co_argfn (wlist->wl_next, command);
} else {
fprintf(cp_err, "%s: too few args.\n", s);

7
src/main.c

@ -1091,6 +1091,13 @@ int main(int argc, char **argv)
cp_nocc = FALSE;
}
if ((iflag || istty) && !ft_batchmode) {
/* Enable interactive prompting. */
bool x_true = TRUE;
cp_vset("interactive", CP_BOOL, &x_true);
}
if (ft_servermode) { /* in server no init file */
readinit = FALSE;
}

1
src/spinit.in

@ -12,7 +12,6 @@ set x11lineararcs
** set the number of threads in openmp
** default (if compiled with --enable-openmp) is: 2
*set num_threads=4
set interactive
strcmp __flag $program "ngspice"
if $__flag = 0

Loading…
Cancel
Save