diff -Naur mc-4.8.18.orig/lib/shell.c mc-4.8.18/lib/shell.c
old
|
new
|
|
66 | 66 | /* 3rd choice: look for existing shells supported as MC subshells. */ |
67 | 67 | if (access ("/bin/bash", X_OK) == 0) |
68 | 68 | mc_shell->path = g_strdup ("/bin/bash"); |
| 69 | else if (access ("/usr/local/bin/mksh", X_OK) == 0) |
| 70 | mc_shell->path = g_strdup ("/usr/local/bin/mksh"); |
| 71 | else if (access ("/bin/mksh", X_OK) == 0) |
| 72 | mc_shell->path = g_strdup ("/bin/mksh"); |
69 | 73 | else if (access ("/bin/ash", X_OK) == 0) |
70 | 74 | mc_shell->path = g_strdup ("/bin/ash"); |
71 | 75 | else if (access ("/bin/dash", X_OK) == 0) |
… |
… |
|
149 | 153 | mc_shell->type = SHELL_ZSH; |
150 | 154 | mc_shell->name = "zsh"; |
151 | 155 | } |
| 156 | else if (strstr (mc_shell->path, "/mksh") != NULL |
| 157 | || strstr (mc_shell->real_path, "/mksh") != NULL) |
| 158 | { |
| 159 | mc_shell->type = SHELL_MKSH; |
| 160 | mc_shell->name = "mksh"; |
| 161 | } |
152 | 162 | else if (strstr (mc_shell->path, "/tcsh") != NULL |
153 | 163 | || strstr (mc_shell->real_path, "/tcsh") != NULL) |
154 | 164 | { |
diff -Naur mc-4.8.18.orig/lib/shell.h mc-4.8.18/lib/shell.h
old
|
new
|
|
12 | 12 | typedef enum |
13 | 13 | { |
14 | 14 | SHELL_NONE, |
| 15 | SHELL_MKSH, |
15 | 16 | SHELL_SH, |
16 | 17 | SHELL_BASH, |
17 | 18 | SHELL_ASH_BUSYBOX, /* BusyBox default shell (ash) */ |
diff -Naur mc-4.8.18.orig/src/subshell/common.c mc-4.8.18/src/subshell/common.c
old
|
new
|
|
320 | 320 | |
321 | 321 | break; |
322 | 322 | |
| 323 | case SHELL_MKSH: |
| 324 | init_file = g_strdup (".profile"); |
| 325 | putenv_str = g_strconcat ("ENV=", init_file, (char *) NULL); |
| 326 | putenv (putenv_str); |
| 327 | break; |
| 328 | |
323 | 329 | /* TODO: Find a way to pass initfile to TCSH, ZSH and FISH */ |
324 | 330 | case SHELL_TCSH: |
325 | 331 | case SHELL_ZSH: |
… |
… |
|
367 | 373 | |
368 | 374 | case SHELL_ASH_BUSYBOX: |
369 | 375 | case SHELL_DASH: |
| 376 | case SHELL_MKSH: |
370 | 377 | case SHELL_TCSH: |
371 | 378 | case SHELL_FISH: |
372 | 379 | execl (mc_global.shell->path, mc_global.shell->path, (char *) NULL); |
… |
… |
|
801 | 808 | "PS1='\\u@\\h:\\w\\$ '\n", subshell_pipe[WRITE]); |
802 | 809 | break; |
803 | 810 | |
| 811 | case SHELL_MKSH: |
| 812 | g_snprintf (precmd, buff_size, |
| 813 | "PS1='$(pwd>&%d; kill -STOP $$)'\"$((( USER_ID )) && print '$ ' || print '# ')\"\n", subshell_pipe[WRITE]); |
| 814 | break; |
| 815 | |
804 | 816 | case SHELL_ASH_BUSYBOX: |
805 | 817 | /* BusyBox ash needs a somewhat complicated precmd emulation via PS1, and it is vital |
806 | 818 | * that BB be built with active CONFIG_ASH_EXPAND_PRMT, but this is the default anyway. |