zsh-autocomplete icon indicating copy to clipboard operation
zsh-autocomplete copied to clipboard

Bug? `sudo` completes from history on up arrow, `ls` goes to last history item?

Open spikespaz opened this issue 1 year ago • 1 comments

What do you want?

How can I search history with text already entered at the prompt in zsh?

https://unix.stackexchange.com/questions/97843/how-can-i-search-history-with-text-already-entered-at-the-prompt-in-zsh

I don't understand how this works currently.

  • When I press down, executables are shown, good.
  • When I type sudo and press up, the history items beginning with sudo are shown.
  • When I type ls and press up, the last-added entry of history is shown. ???

Why does occurrence 3 not use history?

Why do you want this?

I used to have a ZSH configuration (that I cannot seem to find on any drive) that would show history lines whose beginnings matched the string that I had currently typed. It was as if history filtered itself as I typed. I wish to have this feature again.

spikespaz avatar Sep 12 '22 13:09 spikespaz

It works for me. Can you put together a minimal, reproducible test case using the setup below?

cd $(mktemp -d)
git clone --depth 1 -- https://github.com/marlonrichert/zsh-autocomplete.git
> .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
source ~/zsh-autocomplete/zsh-autocomplete.plugin.zsh
EOF
env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d

marlonrichert avatar Sep 19 '22 05:09 marlonrichert

I think that this issue was either a history misconfiguration, or a conflict of keybinds between zsh-edit and this. Both have been resolved.

Question: You make both plugins, why do the default keybinds overlap?

spikespaz avatar Sep 20 '22 08:09 spikespaz

They don’t for this case at least. Zsh Edit does not touch the Up key.

On which keybindings do they overlap?

marlonrichert avatar Sep 20 '22 09:09 marlonrichert