I just installed zsh and oh-my-zsh (my previous shell was bash). My .zshrc
is completely unmodified from oh-my-zsh's default settings. The "git" plugin is the only enabled plugin (it's enabled by default).
I created a very simple theme using this technique:
setopt PROMPT_SUBST
PROMPT='[%D{%L:%M:%S}] '
TMOUT=1
TRAPALRM() {
zle reset-prompt
}
After enabling this theme, I am finding that the up and down arrow keys do not properly recall my history:
- When I press the up arrow once, my most recent command is recalled, as expected.
- When I press the up arrow a second time, nothing happens. I expected my next-most-recent command to be recalled.
- When I press the down arrow after pressing the up arrow the first time, nothing happens. I expected the prompt to go back to the empty prompt I started with.
If I replace my .zshrc
with only the contents of the script above (essentially using the prompt settings from the theme but disabling oh-my-zsh), my up and down arrows work as expected.
If I go back to my oh-my-zsh .zshrc
and comment out the zle reset-prompt
line in my theme, my history works fine (but the clock is no longer live).
How can I use both oh-my-zsh and zle reset-prompt
without causing my up/down arrows to behave differently? Is this a bug in oh-my-zsh, or a configuration error?