diff --git a/src/subshell/common.c b/src/subshell/common.c
index 1c432fd7e..f6f638811 100644
a
|
b
|
do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt) |
1714 | 1714 | return; |
1715 | 1715 | } |
1716 | 1716 | } |
| 1717 | |
| 1718 | // A quick and dirty fix for fish shell. For some reason, fish does not |
| 1719 | // execute all the commands sent to it from Midnight Commander :( |
| 1720 | // An example of such buggy behavior is presented in ticket #4521. |
| 1721 | // TODO: Find the real cause and fix it "the right way" |
| 1722 | if (mc_global.shell->type == SHELL_FISH) |
| 1723 | { |
| 1724 | write_all (mc_global.tty.subshell_pty, "\n", 1); |
| 1725 | subshell_state = RUNNING_COMMAND; |
| 1726 | feed_subshell (QUIETLY, TRUE); |
| 1727 | } |
| 1728 | |
1717 | 1729 | /* The initial space keeps this out of the command history (in bash |
1718 | 1730 | because we set "HISTCONTROL=ignorespace") */ |
1719 | 1731 | write_all (mc_global.tty.subshell_pty, " cd ", 4); |
… |
… |
do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt) |
1778 | 1790 | } |
1779 | 1791 | } |
1780 | 1792 | |
1781 | | /* Really escape Zsh history */ |
1782 | | if (mc_global.shell->type == SHELL_ZSH) |
| 1793 | /* Really escape Zsh/Fish history */ |
| 1794 | if (mc_global.shell->type == SHELL_ZSH || mc_global.shell->type == SHELL_FISH) |
1783 | 1795 | { |
1784 | 1796 | /* Per Zsh documentation last command prefixed with space lingers in the internal history |
1785 | 1797 | * until the next command is entered before it vanishes. To make it vanish right away, |
1786 | | * type a space and press return. */ |
| 1798 | * type a space and press return. |
| 1799 | * |
| 1800 | * Fish shell now also provides the same behavior: |
| 1801 | * https://github.com/fish-shell/fish-shell/commit/9fdc4f903b8b421b18389a0f290d72cc88c128bb |
| 1802 | * */ |
1787 | 1803 | write_all (mc_global.tty.subshell_pty, " \n", 2); |
1788 | 1804 | subshell_state = RUNNING_COMMAND; |
1789 | 1805 | feed_subshell (QUIETLY, TRUE); |