How to set up Tmux to handle Ctrl-Tab and Ctrl-Shift-Tab under mintty/cygwin

708 views
Skip to first unread message

Julien Couvreur

unread,
Feb 21, 2016, 12:14:05 PM2/21/16
to tmux-...@googlegroups.com
Hi,

minTTY sends "^[[1;5I" and "^[[1;6I" for those two key combinations (see [1]).
But it looks like tmux expects something starting with "\033[" from the terminal (see [2]) and does not allow to bind keys by such format as "^[[1;5I" (see [3]).

The result is that tmux only rings a bell when I hit C-Tab with the following configuration:

set-option -gw xterm-keys on
bind-key -n C-Tab next-window
# bind-key -n "^[[1;5I" next-window # Invalid bind command
# bind-key -n "\e[1;5I" next-window # Invalid bind command

For comparison, I was able to bind those keys under gnu-screen with the following configuration:
bindkey "^[[1;5I" next
bindkey "^[[1;6I" prev


Any tips?

Thanks,
Julien

My setup is mintty 2.2.3 with tmux 2.1, installed as part of cygwin/Babun 1.2.0 on windows 8.1.

Nicholas Marriott

unread,
Feb 21, 2016, 3:29:57 PM2/21/16
to Julien Couvreur, tmux-...@googlegroups.com
^[ and \033 are the same. There is no way to specify C-Tab and C-S-Tab
with terminfo.

You could add the keys to xterm-keys.c locally:

{ KEYC_TAB, "\033[1;_I" },

and it should work. But I'm not sure I want to do that because xterm
itself generates \033[27;_;9~ for Tab with modifyOtherKeys set to 2.



On Sun, Feb 21, 2016 at 09:14:04AM -0800, Julien Couvreur wrote:
> Hi,
> minTTY sends "^[[1;5I"**and "^[[1;6I" for those two key combinations (see
> [1]).
> But it looks like tmux expects something starting with "\033[" from the
> terminal (see [2]) and does not allow to bind keys by such format as
> "^[[1;5I" (see [3]).
>
> The result is that tmux only rings a bell when I hit C-Tab with the
> following configuration:
>
> set-option -gw xterm-keys on
> bind-key -n C-Tab next-window
> # bind-key -n "^[[1;5I" next-window # Invalid bind command
> # bind-key -n "\e[1;5I" next-window # Invalid bind command
>
> For comparison, I was able to bind those keys under gnu-screen with the
> following configuration:
>
> bindkey "^[[1;5I" next
> bindkey "^[[1;6I" prev
>
> Any tips?
> Thanks,
> Julien
> My setup is mintty 2.2.3 with tmux 2.1, installed as part of cygwin/Babun
> 1.2.0 on windows 8.1.
>
> [1] [1]https://github.com/mintty/mintty/wiki/Keycodes#special-keys
> [2]**[2]https://github.com/tmux/tmux/blob/master/xterm-keys.c
> [3]**[3]https://github.com/tmux/tmux/blob/dc42c35f1f04d3bd431c52dde0906965c6db2d6c/key-string.c#L140-L214
>
> --
> You received this message because you are subscribed to the Google Groups
> "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [4]tmux-users+...@googlegroups.com.
> To post to this group, send email to [5]tmux-...@googlegroups.com.
> For more options, visit [6]https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. https://github.com/mintty/mintty/wiki/Keycodes#special-keys
> 2. https://github.com/tmux/tmux/blob/master/xterm-keys.c
> 3. https://github.com/tmux/tmux/blob/dc42c35f1f04d3bd431c52dde0906965c6db2d6c/key-string.c#L140-L214
> 4. mailto:tmux-users+...@googlegroups.com
> 5. mailto:tmux-...@googlegroups.com
> 6. https://groups.google.com/d/optout
Reply all
Reply to author
Forward
0 new messages