crossterm
crossterm copied to clipboard
Inconsistent key event of "shifted" characters between Windows and Linux
Describe the bug Inconsistent key event of "shifted" characters between Windows and Linux
To Reproduce Steps to reproduce the behavior:
- Run the official example of crossterm key event: https://docs.rs/crossterm/latest/crossterm/event/index.html
- On US layout keyboard, press
Shift + a
thenShift + /
- See the difference in below table
Key | Windows | Linux |
---|---|---|
Shift + a | Char('A') + SHIFT | Char('A') + SHIFT |
Shift + / | Char('?') + SHIFT | Char('?') + 0x0 |
Expected behavior
- I expect that the same key press will produce the same key event regardless of OS
- I expect in the case of Linux, when pressing Shift + key, the behavior is consistent. You can see in the table above, I got a SHIFT with
Shift + a
but I got 0x0 withShift + /
.
OS Windows and Kali Linux
Terminal/Console
- On Windows: Windows Terminal
- On Kali Linux: the default terminal