Search code examples
zshtmuxoh-my-zshzshrc

The key bind I had set up in zshrc is not working in tmux session


I had set up a key binding for accepting autosuggest suggestions, bindkey '^ ' autosuggest-accept, which works in without tmux activated, however once in tmux this doesn't work anymore.

I suspect it might have something to do with set -g terminal-overrides "$TERM:RGB" in the tmux conf.

Any help will be appreciated.


Solution

  • The keybind should be palced after sourcing source $ZSH/oh-my-zsh.sh for it to be used in the tmux.

    export TERM=tmux-256color
    source $ZSH/oh-my-zsh.sh
    bindkey '^ ' autosuggest-accept
    eval "$(starship init zsh)"
    

    Hope this helps anyone facing the same issue.