title: tmux - Force repeat prefix key for every command
body: <p>Right now my tmux keybindings are set such that prefix + h/j/k/l (i.e vim-style bindings) are used to move focus of the panes left/down/up/right. However, sometimes when I switch to a pane running vim and I immediately start navigating with h/j/k/l, I get stuck in "tmux mode" where it will continue switching panes instead of navigating in vim. I have similar issues when switching to a normal terminal pane and listing files (i.e by using "l"). To avoid this, I would like to force tmux to require the prefix key for every pane switch I do.</p>
  
  <p>Is there a way to do this?</p>
  
  <p>Edit:
  In case its needed, here is my .tmux.conf</p>
  
  <pre><code># Bind CTRL+a to the prefix button
  set -g prefix C-a
  unbind C-b
  bind C-a send-prefix
  bind a send-prefix
  # Remove the delay of escape key
  set -s escape-time 0
  # Bind PREFIX + r to reload the .conf file
  unbind r
  bind r source-file ~/.tmux.conf
  # Quick pane cycling
  unbind ^A
  bind ^A select-pane -t :.+
  
  set -g base-index 1
  setw -g pane-base-index 1
  
  set-option -g default-shell "/bin/bash"
  # List of tmux plugins
  set -g @plugin 'tmux-plugins/tmux-resurrect'
  # Plugin manager
  run '~/.tmux/plugins/tpm/tpm'
  # Enable mouse support on tmux
  set -g mouse on
  # Rebind the pane switching to vim-like shortcuts
  bind -r k select-pane -U
  bind -r j select-pane -D
  bind -r h select-pane -L
  bind -r l select-pane -R
  unbind Up
  unbind Down
  unbind Left
  unbind Right
  unbind C-Up
  unbind C-Down
  unbind C-Left
  unbind C-Right
  # Set the tmux colors to default
  set -g default-terminal screen-256color
  </code></pre>