crossterm icon indicating copy to clipboard operation
crossterm copied to clipboard

Mac doesnt report Shift or Ctrl with enter key

Open pm100 opened this issue 1 year ago • 6 comments

run the event-read example on plain mac terminal (ventura 13.3.1 M1 cpu)

Press shift, hit enter, no key modifier is reported.. Same for control.

If I use iterm2 it works due to the PushKeyboardEnhancementFlags call (If I comment that call out the behavior is the same as for vanilla terminal), but reading the description of that feature it should have no impact.

pm100 avatar Feb 13 '24 20:02 pm100

I suspect that Terminal.app probably doesn't have a way to report those keys at all. There's some good background about the various modes of terminal keyboard reporting on the kitty site, in particular this section https://sw.kovidgoyal.net/kitty/keyboard-protocol/#legacy-key-event-encoding suggests that to report Ctrl/Shift+Enter is something that needs the progressive enhancement.

joshka avatar Feb 15 '24 22:02 joshka

I'm also not seeing Shift or Control modifiers during an Enter key event using Linux. The Alt key works fine though. Pushing DISAMBIGUATE_ESCAPE_CODES and REPORT_ALL_KEYS_AS_ESCAPE_CODES doesn't seem to help. I'm running GNOME terminal 3.44.0 on Ubuntu 22.04

timstr avatar Feb 18 '24 03:02 timstr

Also missing ctrl+backspace on Linux. Switched to Kitty instead of GNOME Terminal and all three combinations (shift+enter, ctrl+enter, ctrl+backspace) are working. Also ligatures FTW

timstr avatar Feb 20 '24 04:02 timstr