From 72544cec5faecc7389431bb19a903bf5f04a820f Mon Sep 17 00:00:00 2001 From: Igor Urazov Date: Mon, 16 Dec 2013 22:06:01 +0200 Subject: [PATCH] Ticket #3124: really escape Zsh history Per Zsh documentation last command prefixed with space lingers in the internal history until the next command is entered before it vanishes. To make it vanish right away, type a space and press return. Signed-off-by: Andrew Borodin --- src/subshell.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/subshell.c b/src/subshell.c index dbee58175f..4706e68cdd 100644 --- a/src/subshell.c +++ b/src/subshell.c @@ -1233,6 +1233,17 @@ do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt) } } + /* Really escape Zsh history */ + if (subshell_type == ZSH) + { + /* Per Zsh documentation last command prefixed with space lingers in the internal history + * until the next command is entered before it vanishes. To make it vanish right away, + * type a space and press return. */ + write_all (mc_global.tty.subshell_pty, " \n", 2); + subshell_state = RUNNING_COMMAND; + feed_subshell (QUIETLY, FALSE); + } + update_subshell_prompt = FALSE; g_free (pcwd);