if I use the up arrow in a zsh session, as you'd expect I get previous commands, from newest to oldest. Now (whether it's zsh or oh-my-zsh doing this I don't know), but if I type the start of a line and hit the up arrow I get the lines from my history that start with whatever I've typed. All good so far.
The problem occurs if I type in a multi line command, eg:
for i in foo bar
echo $i
then if I later hit the up arrow, once it gets to the multi line command it will then only display results starting with for
. So if my history is like:
touch foo
rm foo
for i in foo bar
echo $i
ls
and I hit the up arrow I get the ls
command then the multi-line for
command, and from then on I only see only for
commands that are in my history, rather than the rm
or touch
commands.
Is there any way to be able to search chronologically, without getting stuck whenever the history gets to a multi-line command?
zsh -f
(version 5.0.5). Check especially thebindkey
commands in your personal.zshrc
files, including those sourced by d'oh-my-zsh.bindkey | grep -e '\^\[.A'
?"^[OA" up-line-or-history
and"^[[A" up-line-or-search
~/.oh-my-zsh/lib/key-bindings.zsh
bindkey | grep -e '\^\[.A'
I get two lines returned,"^[OA" up-line-or-beginning-search
and"^[[A" up-line-or-history
. What should I do to remedy the same as OP?