1

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.

1 Answer 1

0

auto-fu has not been updated 7 years. I cannot even get it to work with my current Zsh installation. 😅

I would suggest you instead try out my plugin zsh-autocomplete, which does the same thing (and more!), but without any of the problems you mention. Also, I am actively developing and maintaining it. Please see the demo on the page I linked to for an impression of how it works. 🙂

2
  • Thanks for the link. I think I used a plugin for async completion with the same name before, not sure if it was yours. But I needed limited, yet very specific customized behavior for some widgets and completion contexts, which, if I remember correctly, was easier to do with autofu. I'll check yours out anyway.
    – Bart
    May 22, 2020 at 18:05
  • @Bart And, did you try it? Nov 2, 2021 at 20:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .