1

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:

  1. ls all the files
  2. ls then tab complete and CTRL-C out of the first completion (previous line of prompt gets erased)
  3. ls then tab complete and CTRL-C out of the second completion. The previous line of the prompt doesn't get erased
  4. same as step 2 but with vim instead
  5. same as step 3 but I hit Enter instead of CTRL-C, this is my mistake. However, if I CTRL-C out of this example (the not-first completion) the previous line isn't erased
  6. 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.

paulmelnikow
  • 16,895
  • 8
  • 63
  • 114
Paymahn Moghadasian
  • 9,301
  • 13
  • 56
  • 94
  • 1
    Please post the contents of `PS1` *here*, rather than a link to the script that generates it. – chepner Mar 04 '17 at 02:08
  • Sounds like it might be a bug in Prezto. Prezto has a new community fork. Please open an issue there: https://github.com/zsh-users/prezto/issues – paulmelnikow Mar 04 '17 at 18:06

0 Answers0