Closed wolfsage closed 1 year ago
Legacy terminal keyboard encoding cannot represent ctrl+- you need to use a program that supports kitty's enhanced keyboard protocol.
kitty +kitten show_key -m kitty
for example
LEFT_CONTROL PRESS
CSI 57442 u
Ctrl+- PRESS
CSI 45 ; 5 u
Ctrl+- RELEASE
CSI 45 ; 5 : 3 u
Ctrl+LEFT_CONTROL RELEASE
CSI 57442 ; 5 : 3 u
is what I get with that.
@wolfsage This snippet in kitty.conf
works for me:
map ctrl+' send_text all \x1b[39;5u
map ctrl+( send_text all \x1b[40;5u
map ctrl+) send_text all \x1b[41;5u
map ctrl+, send_text all \x1b[44;5u
map ctrl+- send_text all \x1b[45;5u
map ctrl+. send_text all \x1b[46;5u
map ctrl+; send_text all \x1b[59;5u
map ctrl+= send_text all \x1b[61;5u
There is an entry in regards to this on kitty webpage: Comprehensive keyboard handling in terminals This might explain those escape codes a bit: ANSI Escape Sequences
That doesn't work for me but did give me a hint. I decided to see how other terminal emulators solve this, and rxvt-unicode does:
else if (ctrl && keysym == XK_minus)
{
len = 1;
kbuf[0] = '\037'; /* Ctrl-Minus generates ^_ (31) */
}
\037 = \x1f So I did:
map ctrl+minus send_text all \x1f
And now it works. Cheers
It seems like emitting 1f
for ctrl+- is fairly common, but kitty only does that for ctrl+shift+-, but I don't understand all of this stuff, just what my setup is doing
What do you have set for TERM
? I have xterm-kitty
or xterm-direct
, both works with bindings from snippet above.
Describe the bug
Hi, I'm using a Microsoft Sculpt Ergonomic keyboard (https://www.microsoft.com/en/accessories/products/keyboards/sculpt-ergonomic-desktop?activetab=pivot:overviewtab)
The key combination
ctrl -
does not work, it outputs-
. It seems like--debug-keyboard
confirms this even though it shows a ctrl modifier?To Reproduce
Environment details
Additional context
empty config triggers this as well
Thanks