tcell icon indicating copy to clipboard operation
tcell copied to clipboard

The Name function returns Tab for Ctrl+Tab

Open m-kru opened this issue 1 year ago • 2 comments

The Name() function returns Tab for Ctrl+Tab instead of Ctrl+Tab. This is the case for all non character keys. For example, for Ctrl+Enter the Name() function returns Enter instead of Ctrl+Enter.

https://github.com/gdamore/tcell/blob/88b9c25c3c5ee48b611dfeca9a2e9cf07812c35e/key.go#L206

m-kru avatar Jul 22 '24 14:07 m-kru

Ok, the Ctrl modifier is not set. I wonder who eats the Ctrl key, is it the keyboard or terminal emulator.

m-kru avatar Jul 22 '24 14:07 m-kru

Interestingly, Alt+Tab returns Alt+Tab.

m-kru avatar Jul 22 '24 14:07 m-kru

Tab is kind of weird. Its actually a synonym for Control - I for legacy (as in from the 1970s or 1980s) reasons.

At some point we'll probably adopt the kitty keyboard protocol, and then at least for modern terminals things will get better.

gdamore avatar Jul 10 '25 23:07 gdamore

The terminal emulator may also eat it. But I think there is no way (at least on UNIX/Linux) for control tab to be expressed.

gdamore avatar Jul 10 '25 23:07 gdamore