I am trying to configure tmux to switch between windows using alt-left, alt-right sequences. This is what I have in my .tmux.conf
bind-key -n M-Left previous-window
bind-key -n M-Right next-window
Unfortunately, it doesn't work. On my machine, alt-left and alt-right are bound to ^[[1;3D and ^[[1;3C respectively. I think I have to use terminfo override to tell tmux to use these sequences, but I have no idea how. So, any help will be appreciated.
Thanks!
If the
xterm-keysoption was off,tmuxwould ignore the keys (because it would recognize them and discard them when the option was not set). Users oftmuxhave been confused by this distinction for a while, and at the end of 2016, the developer changed the default for the option:This still relies upon the terminal description, as I pointed out in tmux on remote machine not getting correct prefix + arrow keys