I was trying to find a command for "leaving copy-mode" from this page, but it seems only the key binding prefix+q exists for this function; i.e., I can't find the associated :command
-style command.
Does this mean it is impossible to bind another key to "leave copy-mode"? I'd like to bind the Esc key.
To get out of Copy mode, we just press the ENTER key. Moving around one character at a time isn't very efficient. Since we enabled vi mode, we can also use some other visible shortcuts to move around the buffer. For example, we can use "w" to jump to the next word and "b" to jump back one word.
The solution is to use tmux specific controls to access its own scrollback buffer: Ctrl-b then [ to enter copy mode, use Down/Up arrows or PageDown and PageUp keys, q or Enter to exit copy mode.
Copy mode uses its own set of commands, separate from tmux
itself. Use send-keys -X
to "type" commands in copy mode, as demonstrated by the default binding for exiting copy mode:
bind-key -T copy-mode q send-keys -X cancel
Note that Escape is already bound to the same command, at least in tmux
2.7.
% tmux list-keys | grep "send-keys -X cancel"
bind-key -T copy-mode C-c send-keys -X cancel
bind-key -T copy-mode Escape send-keys -X cancel
bind-key -T copy-mode q send-keys -X cancel
bind-key -T copy-mode-vi C-c send-keys -X cancel
bind-key -T copy-mode-vi q send-keys -X cancel
The page you were referring to is not a comprehensive list of tmux
commands, but rather a comparison of how to accomplish some common tasks in different terminal multiplexers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With