Skip to main content
edited title
Link
Bart
  • 247
  • 1
  • 11

How can I omit zsh completions from the scrollback buffer?

Source Link
Bart
  • 247
  • 1
  • 11

How can I zsh completions from the scrollback buffer?

I have a zsh configuration with auto-completion (auto-fu) and the option no_always_last_prompt, which will re-print the prompt and the current command line buffer below completions.

Is there a way not to include completions in the scrollback buffer and keep the prompt to the bottom of the screen while editing the command line?

I would like to:

  • make it work in the linux console, but I'm ok with tmux or dvtm, so if I could display completions in another pane, that could be acceptable;
  • "clear" completions from the scrollback buffer, perhaps from the precmd hook function, form completion widgets and upon accept-line;
  • modify the clear-screen widget to print $LINES empty lines and then zle .reset-prompt && zle -R (I'll also try to replace /usr/bin/clear)

I'm thinking to use escape sequences to automatically delete the required number of lines to get rid of printed completions and somehow scroll or re-print the prompt at the bottom. Note that I'd like to preserve previous command output lines. They should be visible above completions.