3

My question is pretty much exactly as the post below, but the answers to the below post do not specify the lines added to .tmux.conf. Specifically I would like to know how to bind ctrl-shift-A to "select-pane -L". I am using tmux 2.6 with cygwin/mintty with the "Ctrl+Shift+letter shortcuts" option turned on.

How do I use Ctrl-Shift keyboard shortcuts for Tmux, with Cygwin/Mintty?

I have not been able to get any of the following to work:

# try to specify ctrl-shift-A directly
bind-key -n C-S-A select-pane -L

# try to use mintty ctrl-shift-A character code for UTF-8
set -s user-keys[0] "\xC2\x81"
bind-key -n User0 select-pane -L

# try to use mintty ctrl-shift-A character code for ISO-8859
set -s user-keys[0] "\x81"
bind-key -n User0 select-pane -L

Some other useful links:

https://stackoverflow.com/questions/35533839/how-to-bind-ctrl-tab-and-ctrl-shift-tab-in-tmux-for-mintty

https://github.com/mintty/mintty/wiki/Keycodes#ctrl

Any help will be much appreciated. Thanks!

Edit:

after turning OFF "Ctrl+Shift+letter shortcuts" in mintty I was able to run the xxd command, hit [ctrl-shift-A], [enter] then [ctrl-d] and got the following output:

> xxd

00000000: c281 0a                                  ...

I believe this shows that ctrl-shift-A is now being registred as \xc2\x81 as the mintty Keycodes suggests. However, I still can't get the tmux bindings to work after setting my .tmux.conf file to the following and sourcing the config:

bind-key -n \xc2\x81 select-pane -L

If I just type ctrl-shift-A inside of bash in mintty it gives the following: "bash: $'\302\201': command not found". Not sure if that's useful.

1 Answer 1

0

Use octal syntax in combination with user-keys and "Ctrl+Shift+letter shortcuts" disabled:

set -s user-keys[0] "\302\201" # octal of ctrl+shift+a
bind-key -n User0 select-pane -L

See http://man7.org/linux/man-pages/man1/tmux.1.html#PARSING_SYNTAX for more details. I believe you can also use the \u syntax.

You can get octal codes for keypresses by running showkey -a in WSLtty.

I could not find a way to keep both Ctrl+C Ctrl+V in mintty and Ctrl+Shift+letter bindings in tmux.

You must log in to answer this question.

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