mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
Ticket #4549: subshell: call execl with argv[0] being the actual path to Bash.
We currently call Bash with argv[0] being just the fixed string "bash", but this confuses Bash when it initializes the shell variable BASH, which are expected to be the absolute file path to the current Bash image. This patch fixes argv[0] to be the actual path that mc uses to start Bash. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
ed2c15cc68
commit
61675a90a8
@ -418,13 +418,13 @@ init_subshell_child (const char *pty_name)
|
||||
switch (mc_global.shell->type)
|
||||
{
|
||||
case SHELL_BASH:
|
||||
execl (mc_global.shell->path, "bash", "-rcfile", init_file, (char *) NULL);
|
||||
execl (mc_global.shell->path, mc_global.shell->path, "-rcfile", init_file, (char *) NULL);
|
||||
break;
|
||||
|
||||
case SHELL_ZSH:
|
||||
/* Use -g to exclude cmds beginning with space from history
|
||||
* and -Z to use the line editor on non-interactive term */
|
||||
execl (mc_global.shell->path, "zsh", "-Z", "-g", (char *) NULL);
|
||||
execl (mc_global.shell->path, mc_global.shell->path, "-Z", "-g", (char *) NULL);
|
||||
break;
|
||||
|
||||
case SHELL_ASH_BUSYBOX:
|
||||
|
Loading…
Reference in New Issue
Block a user