Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent keybindings behavior for Alt Shift Combinations #3305

Open
Neko-Box-Coder opened this issue May 19, 2024 · 4 comments
Open

Inconsistent keybindings behavior for Alt Shift Combinations #3305

Neko-Box-Coder opened this issue May 19, 2024 · 4 comments

Comments

@Neko-Box-Coder
Copy link
Contributor

Description of the problem or steps to reproduce

When using the same keybindings on Windows and Linux, one works and the other does not.

Given there are two keybindings that are the same but displayed differently

  • Alt-Shift-E
  • Alt-E

The first one works on Windows but not on Linux, vice versa for the second one.

I tried both by pointing it to empty config directory using micro -config-dir ./tmp and modifying the keybindings there

When running raw, I can see indeed it is capturing different things

On Linux

EventKey: Alt-E: "\x1bE"

On Windows

EventKey: Shift-Alt-E: ""

Specifications

Commit hash: 1f51d0b (Windows) 9176508 (Linux)
OS: Windows 11 and Arch Linux
Terminal: WezTerm

@dmaluka
Copy link
Collaborator

dmaluka commented May 19, 2024

Yeah, on Unix it is Alt-E, with capital E (note that it is different from Alt-e), since Shift-e is the capital E letter.

This is one of many unfortunate consequences of all the legacy crap that Unix terminals have and the lack of standardization between them, as well as the lack of standardization between Unix and Windows terminals.

@Neko-Box-Coder
Copy link
Contributor Author

Yeah, right now I have 2 versions of keybindings (1 with Shift 1 without) that binds to the same action as a workaround so that I can use the same json for both Linux and Windows.

I will create a PR to fix this.

@Neko-Box-Coder
Copy link
Contributor Author

Neko-Box-Coder commented May 22, 2024

@JoeKar
This is actually kinda similar to #3304 and the fix I am working on at the moment is to try both "Alt-E" and "Alt-Shift-E" if it is a capital letter and stop trying if we matched.

This is less important than #3304 (but slightly inconvenient) so I am not too fussed about getting this sorted quickly. But my question would be should tcell be producing consistent output for this as well, considering tcell is just spitting out whatever it receives and this count as the quirks with linux vs windows.

@JoeKar
Copy link
Collaborator

JoeKar commented May 23, 2024

I assume that this is related to tcell's input mode and how it receives the the key codes. Currently the terminal generates a Shift+e instead of a E, which results in Shift-Alt-E, while under Linux it receives the E directly (without the Shift) and this is then Alt-E.
Maybe the situation would be different, when tcell activates modeVtInput, but this is just an untested guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants