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

Make key combinations with letter keys case-insensitive #1879

Open
1 task done
xiaq opened this issue Dec 30, 2024 · 0 comments
Open
1 task done

Make key combinations with letter keys case-insensitive #1879

xiaq opened this issue Dec 30, 2024 · 0 comments

Comments

@xiaq
Copy link
Member

xiaq commented Dec 30, 2024

What new feature should Elvish have?

Keybindings in Elvish are case sensitive. For example, Alt-x stands for the key combination Alt + X, while Alt-X stands for the combination Alt + Shift + X. On the other hand, the key combination Ctrl + X has to be spelt as Ctrl-X, not Ctrl-x. These are more of a result of historical quirks than rational choice.

I posit that when we think about key combinations we indeed think about keys (as opposed to characters), so we think of the x and X in Alt-x and Alt-X both as "the X key", not as lower-case and upper-case characters, hence it's more intuitive if both just mean the key combination Alt + X. Elvish making a distinction between the two is counter-intuitive. Instead, Elvish should call the key combination Alt + X Alt-X (or Alt-x, or alt-x), and call the key combination Alt + Shift + X Alt-Shift-X (or Alt-Shift-x, or alt-shift-x).

The discussion so far only touches on key combinations with letter keys, which leaves two other classes:

  • Key combinations not involving letter keys, like Alt-!. This should remain unchanged, even though on a US layout keyboard it's typed as Alt + Shift + 1. This is because whether ! is shifted from 1 depends on the keyboard layout, and the problem with case sensitivity doesn't exist here, so hopefully there's no confusion about what Alt-! means, although unfortunately there's still ambiguity around whether the combination should be spelt as Alt-! or Alt-Shift-1.

  • Lone letter keys, like just x. I'm a bit ambivalent about whether X should be changed to Shift-X.

Some research into how other terminal applications spell key combinations may also be illuminating.

Output of "elvish -version"

irrelevant

Code of Conduct

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

No branches or pull requests

1 participant