I'm trying to make iTerm2 and tmux play nicer with eachother (without using the builtin tmux functions; I'd like my windows and panes managed by myself).
Therefore, I want to map ⌘+→ to a key sequence starting with ^Q (my tmux prefix), followed by →.
^Q is 0x11
, and → is ^[[C
, i.e. 0x1b 0x5b 0x43
. However, if I try to make this mapping in the iTerm Preferences (Keys→Key Mappings, with the "Send Hex Codes" setting), it doesn't work, i.e. it doesn't switch my panes as I would expect.
If, shortly after pressing ⌘+→ I press → again, the active pane to the right is selected, so the ^Q must be coming through. If I just map it to 0x1b 0x5b 0x43
(→), it works, too.
Is this a limitation of iTerm2 itself; can I not send longer key sequences? Is it sending the keys too fast for tmux?
I also tried using the "Send with vim special keys" setting, but it doesn't seem to work at all; if I enter "<C-Q><Right>" it sends that text literally.
iTerm2 Build 3.0.8 on macOS Sierra.