Closed tapyu closed 1 year ago
Same problem, I had trouble browsing history using up arrow key, twice pressing is needed, and the anoying terminal bell always rings.
After all the search I found the issue #646 suggesting adding the two bindkey commands but did not work immediately for me. After that the issue #618 gave me a hint: following the direction, I identified that up arrow is encoded as ^[OA in my workstation.
Finally, the two lines of code solved my problem:
bindkey "^[OA" history-beginning-search-backward bindkey "^[OB" history-beginning-search-forward
I also have this problem, the difference I am using Ctrl+P / Ctrl+N instead of the up/down arrows.
bindkey '^P' history-beginning-search-backward-end
bindkey '^N' history-beginning-search-forward-end
The suggestion @hongwen000 doesn't work for me. Notice that history-beginning-search-backward
is different from history-beginning-search-backward-end
(the -end). The cursor will stay in the end.
I had to do modifications suggested here https://github.com/zsh-users/zsh-autosuggestions/issues/619#issuecomment-904193190 . After that not only that arrows worked after pressing just once, but it also resolved my issues with history. I could only go back like 5 commands and then it stopped working.
Thanks!!! I confirm this solved the issue. I added:
ZSH_AUTOSUGGEST_CLEAR_WIDGETS+=(history-beginning-search-backward-end history-beginning-search-forward-end)
Closing as a duplicate of #619
Describe the bug
Dears,
I am using the following snippet from a stack exchange answer:
This allows me to search through my history from the already entered text at the prompt. However, the
zsh-autosuggestions
plugin has conflicts with this snippet, which obligates me to press uparrow twice in order to search through the historyTo Reproduce
zsh-autosuggestions
pluginExpected behavior
I would like to use the
zsh-autosuggestions
plugin and perform this search history in a minimal configuration. At the moment, I am using the joshskidmore/zsh-fzf-history-search plugin to make this task, but it is more desirable to use this snippet.Anyone has an way out or can identify what is happening?
Desktop
Additional context
works properly with the
zsh-autosuggestions
plugin. I think that the conflict is related tohistory-search-end
load of thezsh
.