To exit copy mode in tmux, press q or Escape. If you're using Vim keybindings, you can also press Enter to exit copy mode after making a selection. Another method is to press Ctrl+c, which cancels the current operation and exits copy mode regardless of keybinding mode.
# Exit copy mode (Emacs key bindings) q Escape # Exit copy mode (Vim key bindings) q Escape Enter (after selection)
Copy mode in tmux allows you to navigate the pane buffer, select text, and copy content for pasting. Knowing how to exit copy mode is essential for efficient tmux usage, especially as different key binding modes offer different exit methods.
Regardless of your key binding mode, these methods should work to exit copy mode:
tmux supports two main key binding modes for copy mode: Emacs (default) and Vim. The exit methods can vary slightly:
Emacs mode (default):
Vim mode:
To check which key binding mode you're using for copy mode:
# In tmux command mode (Ctrl+b :) show-options -g mode-keys
This will show either "emacs" (default) or "vi" depending on your configuration.
If you prefer Vim-style key bindings for copy mode, add this to your ~/.tmux.conf
:
# Use vi keys in copy mode setw -g mode-keys vi
For Emacs-style key bindings (default):
# Use emacs keys in copy mode setw -g mode-keys emacs
If you're having trouble exiting copy mode:
Create a custom binding for quickly exiting copy mode and returning to the command prompt:
# Add to ~/.tmux.conf bind-key -T copy-mode-vi 'C-x' send-keys -X cancel bind-key -T copy-mode 'C-x' send-keys -X cancel
With this configuration, pressing Ctrl+x will immediately exit copy mode regardless of which key binding mode you're using.
For a smooth copy-paste workflow in tmux: