Here's an actual fix. Add the following to .tmux.conf
:
set -s escape-time 0
As mentioned in the comments: The server may need to be restarted.
tmux kill-server
kills the server; you may need to restart it.
Alternatively, you can reload the configuration file
from the command prompt inside tmux
by typing your tmux prefix
(default Ctrl+B) followed by :
and entering source-file ~/.tmux.conf
.
Available Keys
Look at man tmux
, search / for KEY BINDINGS
:
tmux allows a command to be bound to most keys, with or without a prefix key.
When specifying keys, most represent themselves (for example ‘A’ to ‘Z’).
Ctrl keys may be prefixed with ‘C-’ or ‘^’, and Alt (meta) with ‘M-’.
In addition, the following special key names are accepted:
Up, Down, Left, Right, BSpace, BTab, DC (Delete), End, Enter, Escape, F1 to F20,
Home, IC (Insert), NPage/PageDown/PgDn, PPage/PageUp/PgUp, Space, and Tab.
Note that to bind the ‘"’ or ‘'’ keys, quotation marks are necessary [...]
M-S-Left should be Alt+Shift+Left for example.
List all bound keys
To list all key bindings, simply press Ctrl-b then ? while in a tmux
session.
This is also documented in man tmux
in section EXAMPLES
:
Typing ‘C-b ?’ lists the current key bindings in the current window; up and down may be used to navigate the list or ‘q’ to exit from it.
You can also list all key-bindings via tmux list-keys
. If you want to check for already set keys, you can grep
it's output to check, if it's already set.
Research
To find more via Google, search for Section names in man tmux
- just type in tmux default key bindings
for example :). But often man tmux
is sufficient.
This site is a very good documentation about tmux
and pops up, if you search for said string in Google.
Arch wiki is always good, too.
Best Answer
You can send literal escape (and newline) with ANSI-C quoting (there's more about that here), e.g. to send escape to
0:0
:For your mapping, assuming I understand it correctly, you could do something like this:
Note that the escape will always be sent, so to work around the issue of the shell receiving the escape, you could send an extra newline: