mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-03 18:14:25 +03:00
* 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".
This commit is contained in:
parent
022fce89cb
commit
915136719d
@ -1,5 +1,10 @@
|
|||||||
2003-03-22 Adam Byrtek <alpha@debian.org>
|
2003-03-22 Adam Byrtek <alpha@debian.org>
|
||||||
|
|
||||||
|
* 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).
|
* subshell.c: Remove dead code (SYNC_PTY_SIDES).
|
||||||
(init_subshell_child): Remove dead code (initfile for TCSH).
|
(init_subshell_child): Remove dead code (initfile for TCSH).
|
||||||
(init_subshell): Use ZSH_VERSION environment variable to detect
|
(init_subshell): Use ZSH_VERSION environment variable to detect
|
||||||
|
@ -172,7 +172,7 @@ void do_cd_command (char *cmd)
|
|||||||
|
|
||||||
/* Returns 1 if the we could handle the enter, 0 if not */
|
/* Returns 1 if the we could handle the enter, 0 if not */
|
||||||
static int
|
static int
|
||||||
enter (WInput * cmdline)
|
enter (WInput *cmdline)
|
||||||
{
|
{
|
||||||
Dlg_head *old_dlg;
|
Dlg_head *old_dlg;
|
||||||
|
|
||||||
@ -199,6 +199,16 @@ enter (WInput * cmdline)
|
|||||||
|
|
||||||
return MSG_NOT_HANDLED;
|
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 = g_malloc (strlen (cmd) + 1);
|
||||||
command[0] = 0;
|
command[0] = 0;
|
||||||
for (i = j = 0; i < strlen (cmd); i++) {
|
for (i = j = 0; i < strlen (cmd); i++) {
|
||||||
|
@ -179,9 +179,6 @@ int navigate_with_arrows = 0;
|
|||||||
/* If true use +, -, | for line drawing */
|
/* If true use +, -, | for line drawing */
|
||||||
int force_ugly_line_drawing = 0;
|
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
|
/* 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
|
command ran in the subshell to the description found in the termcap/terminfo
|
||||||
database */
|
database */
|
||||||
@ -582,7 +579,7 @@ shell_execute (char *command, int flags)
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||||
if (use_subshell)
|
if (use_subshell)
|
||||||
if (subshell_state == INACTIVE || force_subshell_execution)
|
if (subshell_state == INACTIVE)
|
||||||
do_execute (shell, command, flags | EXECUTE_AS_SHELL);
|
do_execute (shell, command, flags | EXECUTE_AS_SHELL);
|
||||||
else
|
else
|
||||||
message (1, MSG_ERROR,
|
message (1, MSG_ERROR,
|
||||||
@ -2259,8 +2256,6 @@ static const struct poptOption argument_table[] = {
|
|||||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||||
{"nosubshell", 'u', POPT_ARG_NONE, NULL, 'u',
|
{"nosubshell", 'u', POPT_ARG_NONE, NULL, 'u',
|
||||||
N_("Disables subshell support")},
|
N_("Disables subshell support")},
|
||||||
{"forceexec", 'r', POPT_ARG_NONE, &force_subshell_execution, 0,
|
|
||||||
N_("Force subshell execution")},
|
|
||||||
#endif
|
#endif
|
||||||
{"printwd", 'P', POPT_ARG_STRING, &last_wd_file, 0,
|
{"printwd", 'P', POPT_ARG_STRING, &last_wd_file, 0,
|
||||||
N_("Print last working directory to specified file")},
|
N_("Print last working directory to specified file")},
|
||||||
|
Loading…
Reference in New Issue
Block a user