Prezto: CTRL-C eats previous line of prompt

Created on 6 Mar 2017  ·  8Comments  ·  Source: sorin-ionescu/prezto

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.

I thought that #1245 was this issue but checking the version of zsh shows I'm on 5.2:

 ❯❯❯ zsh --version                                                                                                                                                                                                                                                                                                                                      (master) 11:20AM
zsh --version
zsh 5.2 (x86_64-redhat-linux-gnu)
Bug Upstream

All 8 comments

I'm on commit 4f19700919c8ebbaf75755fc0d03716d13183f49 for prezto. I checked this by cding into ~/.zprezto and running git log

Hm, I see something similar to this with tab completion eating the previous line with multiline prompts... not sure what would be causing it yet though.

@belak #1245

Thanks for the information! I'll keep an eye out for 5.3.2 and close this when it's fixed.

I have the same issue as @cmcginty, especially when completing paths in a "git add" command...

I assume this is fixed now that 5.4.2 is out. Please feel free to let me know if it's still broken.

It is! Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

entertvl picture entertvl  ·  3Comments

ww7 picture ww7  ·  4Comments

gdetrez picture gdetrez  ·  5Comments

kud picture kud  ·  3Comments

adrian-amaglio picture adrian-amaglio  ·  5Comments