How do I get searching through my command history working with tmux and zshell?

Solution 1:

Do you have an export EDITOR=vi somewhere in your .zshrc anywhere? I had a similar problem to this where C-a C-e and C-r worked fine until I started tmux. Turns out that the inner zsh was picking up on my EDITOR variable and switching keybindings to vi style. Setting up my .zshrc like this solved the problem:

# Use vi as the default editor
export EDITOR=vi

# But still use emacs-style zsh bindings
bindkey -e

Solution 2:

Wound up adding bindkey '^R' history-incremental-search-backward to my .zshrc file and things are working.