Home

Awesome

tmux-keybtest

tmux-keybtest is a utility for identifying which key sequences tmux can detect in your terminal. When you press a key, its tmux name, like C-M-Up, will be displayed on the status line if recognized.

Terminals can sometimes misinterpret key presses, generating the wrong sequence or nothing at all. tmux-keybtest helps you evaluate which keys are available in your current terminal and can assist in selecting a terminal with better support for key sequences.

Note: If your operating system or terminal has already bound certain keys, tmux may not detect them. It may be possible to reconfigure your system or terminal to free up these keys for tmux use.

Currently, support is provided for basic alphabetic characters (a-z) and Swedish umlauts (å, ä, ö). If your keyboard includes other language-specific characters or special symbols that aren't recognized, please let me know, and I'll be happy to add support for them.

All other keys found on a standard US keyboard, such as punctuation marks and symbols, are already handled and do not require additional definitions.

Usage

  1. Clone this repository and navigate to its directory.
  2. Run keybtest.sh to start a tmux session that will display the tmux notation for any recognized key press.

Important Notes

tmux Key Name Prefixes

Use the key names displayed to customize your tmux.conf according to your terminal's capabilities.

Keys Not Tested

Shift S-

Control C-

Control Shift C-S-

Meta Shift M-S-

Control Meta C-M-

Control Meta Shift C-M-S-

Additional Information

Handling Terminals That Can't Send Correct Sequences

If a terminal generates a sequence that tmux recognizes but is not the intended one (e.g., Alt+Up generates S-F3), bind the desired action to the detected sequence (S-F3).

If a terminal generates an unrecognized but unique sequence, you can bind it to an action using user-keys. Tmux requires octal notation for user-keys, formatted as three digits and prefixed with \\.

Example:

set -s user-keys[101] "\\342\\201\\204"
bind -n User101 send-keys F1

Checking Terminal Key Sequences

To determine what sequence a key generates, use the following commands outside of tmux: