diff --git a/src/ChangeLog b/src/ChangeLog index 0d09363ce..b224419d2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2003-03-22 Adam Byrtek + * command.c (enter): Check subshell state early and return if + inactive before clearing the command line. + * main.c (force_subshell_execution): Remove magic, unusable, + undocumented command line option "-r". + * subshell.c: Remove dead code (SYNC_PTY_SIDES). (init_subshell_child): Remove dead code (initfile for TCSH). (init_subshell): Use ZSH_VERSION environment variable to detect diff --git a/src/command.c b/src/command.c index 61021f117..6024adf01 100644 --- a/src/command.c +++ b/src/command.c @@ -172,7 +172,7 @@ void do_cd_command (char *cmd) /* Returns 1 if the we could handle the enter, 0 if not */ static int -enter (WInput * cmdline) +enter (WInput *cmdline) { Dlg_head *old_dlg; @@ -199,6 +199,16 @@ enter (WInput * cmdline) return MSG_NOT_HANDLED; } +#ifdef HAVE_SUBSHELL_SUPPORT + /* Check this early before we clean command line + * (will be checked again by shell_execute) */ + if (use_subshell && subshell_state != INACTIVE) { + message (1, MSG_ERROR, + _(" The shell is already running a command ")); + return MSG_NOT_HANDLED; + } +#endif + command = g_malloc (strlen (cmd) + 1); command[0] = 0; for (i = j = 0; i < strlen (cmd); i++) { diff --git a/src/main.c b/src/main.c index 14617467c..a039e8a89 100644 --- a/src/main.c +++ b/src/main.c @@ -179,9 +179,6 @@ int navigate_with_arrows = 0; /* If true use +, -, | for line drawing */ int force_ugly_line_drawing = 0; -/* If true message "The shell is already running a command" never */ -int force_subshell_execution = 0; - /* If true program softkeys (HP terminals only) on startup and after every command ran in the subshell to the description found in the termcap/terminfo database */ @@ -582,7 +579,7 @@ shell_execute (char *command, int flags) { #ifdef HAVE_SUBSHELL_SUPPORT if (use_subshell) - if (subshell_state == INACTIVE || force_subshell_execution) + if (subshell_state == INACTIVE) do_execute (shell, command, flags | EXECUTE_AS_SHELL); else message (1, MSG_ERROR, @@ -2259,8 +2256,6 @@ static const struct poptOption argument_table[] = { #ifdef HAVE_SUBSHELL_SUPPORT {"nosubshell", 'u', POPT_ARG_NONE, NULL, 'u', N_("Disables subshell support")}, - {"forceexec", 'r', POPT_ARG_NONE, &force_subshell_execution, 0, - N_("Force subshell execution")}, #endif {"printwd", 'P', POPT_ARG_STRING, &last_wd_file, 0, N_("Print last working directory to specified file")},