I have a multi-line prompt in zsh. I've found that sometimes when I CTRL-C
out of an autocompletion the previous line of the prompt gets erased unexpectedly. Here's a gif showing this happening with ls
, vim
and fzf
: http://imgur.com/1jTrrzA
Here's an outline of events that happen:
ls
all the filesls
then tab complete andCTRL-C
out of the first completion (previous line of prompt gets erased)ls
then tab complete andCTRL-C
out of the second completion. The previous line of the prompt doesn't get erased- same as step 2 but with
vim
instead - same as step 3 but I hit
Enter
instead ofCTRL-C
, this is my mistake. However, if ICTRL-C
out of this example (the not-first completion) the previous line isn't erased - Show how
fzf
suffers from the same problem several times
I've found that the issue as shown during step 2 and step 4 still exists with a single line prompt. However fzf
isn't broken with a single line prompt.
My entire prompt can be found at http://pastebin.com/JwufRy6m which is a modified version of https://github.com/sorin-ionescu/prezto/blob/master/modules/prompt/functions/prompt_sorin_setup to work with mercurial repositories at my company. The lines of interest (I think) in my prompt file are 166 and 167 (line 167 == line 166 minus $prompt_newline
).
I've tried creating a multiline prompt without using $prompt_newline
by doing:
NEWLINE=$'\n'
PROMPT=.....${NEWLINE}....
But that didn't help either which kinda makes sense to me because part of the problem still exists with single-line prompts.