I'd like to use the numeric keypad to select windows in tmux. Anybody do this?
If your terminal emulator outputs certain codes for the keypad keys, then these commands (e.g. in your
You can check whether your terminal emulator sends special codes for the keys by running this outside tmux:
(use Control+c to end the
You should probably see something like this for KP0–KP9:
This works for me by default in iTerm2 (Build 22.214.171.12420724), but in Terminal (Version 2.3 (309); from OS X 10.8.2) I had to enable Allow VT100 application keypad mode for a profile (Terminal menu > Preferences…; Settings tab > select a profile > Advanced tab; check Allow VT100 application keypad mode under Emulation).
If you have numlock enabled, the keypad sends the same input to the terminal as the number keys above the qwerty letters, so there's no way to specify the keypad specifically. You can try to map the non-numlocked inputs from the keypad, but I think that's specific to your keyboard and terminal.
To map a key without requiring Prefix, use