2

I want to use "1-step" keyboard shortcuts for Tmux, when used from Cygwin/Mintty. I can't get them to work, so for now I have to use the default "2-step" keyboard shortcuts for Tmux, which I don't like at all.

"1-step" shortcuts:

  • Ctrl+Shift+W
  • Ctrl+Shift+X

"2-step" ones:

  • press Alt+A, let go of Alt+A, press W
  • Alt+A, let go of Alt+A, press X

My previous setup was Cygwin + ConzoleZ, a Windows console with tabs and splits/panes. Unfortunately ConsoleZ still uses conhost.exe, the Windows console, with all its limitations. So I decided to use Mintty instead, which is a xterm-compatible console. However, Mintty doesn't have tabs or panes so I decided to use Tmux, since it can provide both.

However, due to console limitations, Tmux uses a command prefix which is the first "step" of any command. I've bound mine to Alt-a for convenience. So all the commands are Alt-a, let go of Alt-a, press something else. Not really ergonomic.

I've been checking the Mintty and Tmux documentation for anything that can help, but I'm probably still missing something.

So far I managed to bind Ctrl+Tab and Ctrl+Shift+Tab to rotate through tabs. I've also found that Mintty does emit some special escape sequences for the shortcuts I want to use (Ctrl+Shift+<...>). However, I don't know how to bind those to the commands I want.

I also saw that Tmux can have keyboard shortcuts without prefix, by using:

bind-key -n <key> <command>

So in theory I'm really close.

The question is: how do I actually map the special escape sequences to commands? I think it should be doable using user-keys, just as in the example for Ctrl-Tab, but how can I list or otherwise see the Tmux escape sequence generated by Mintty for the keyboard shortcuts I want?

The list would be: Ctrl+Shift+\, Ctrl+Shift+-, Ctrl+Shift+X, Ctrl+Shift+T, Ctrl+Shift+W, Ctrl+Shift+→/↑/→/↓, Ctrl+Shift+Z, maybe a few others.

0

1 Answer 1

3

I am not using TMux, but I suspect you need to verify the Ctrl-Shift setting of Mintty

enter image description here

1
  • It was a mix of this setting and using a newer Tmux version. Cygwin comes with Tmux 2.5 and I had to compile and install Tmux 2.6 to have these shortcuts working.
    – oblio
    Nov 17, 2017 at 9:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .