I’ve noticed that if I press up arrow at a prompt then I get the previous command and up again gets me the command before that.
Whereas if I press up arrow before the previous program has completed then instead I get the previous command displayed, the cursor is at the end of the line, but oh-my-zsh is now in “search for lines that start with … ” mode meaning I can’t press up to get the previous command.
I’m sure this behavior is well known and expected but just in case you don’t get it you can repo it like this
- wait 3 seconds for prompt to appear
- press ⬆ (should show
- press ⬆ again (should show
- press return (to run
sleep 3return ⬆ (press the up arrow before the 3 seconds elapses)
- It should now be showing
- Press ⬆
it will still be showing
sleep 3but it want it to be showing
ls. Instead it is in “search for commands that start with
sleep 3mode instead of just
go to previous commandmode.
To make try to clear in both cases these are the steps
- sleep 3return
But they end up with different results depending on if step3 happens before step2 finished or after.
Note I saw this Q&A: How to make oh-my-zsh history behavior similar to Bash's?
But that doesn’t seem to be what I’m looking for. I like oh-my-zsh’s partial line + up = search for lines that start with the partial. What I’m trying to fix is that if I press up on step 2 above it magically inserts a partial where as if I wait until step 2 finishes it doesn’t.
How do I get oh-my-zsh to be consistent here so that a premature up arrow behaves the same as a normal up arrow? Thank you