I have
# auto-complete
autoload -U up-line-or-beginning-search
autoload -U down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey "^[[A" up-line-or-beginning-search
bindkey "^[[B" down-line-or-beginning-search
in my .zshrc. This works as expected normally, e.g. writing ssh and pressing the up arrow will cycle through all ssh commands in the history.
However, if I ssh into a server first and the exit back into my local terminal, pressing the up arrow ignores what has been written and simply cycles through the history, i.e. it shows all commands; not commands only starting with ssh. This only happens when I ssh into a server that has an older ZSH version. If I ssh into a server with the same ZSH version, everything works as expected.
The server has an empty .zshrc. My ZSH versions are zsh 5.7.1 (x86_64-debian-linux-gnu) for the server running Debian 10 and zsh 5.9 (x86_64-pc-linux-gnu) for the local machine running Arch. Any idea how to fix this?
tput rmkx
orprintf "\e[?1l"
?