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

Add duplicate bindings for terminals that support enhanced keys #139

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

ulyssa
Copy link
Owner

@ulyssa ulyssa commented Apr 24, 2024

I enabled the Kitty keyboard enhancements in ulyssa/iamb#272, but this broke using some keybindings like <C-I> and <C-[> since they no longer get sent as <Tab> and <Esc> respectively. These (and similar) should have duplicate entries in the Vim and Emacs keybindings so that enabling improved keypresses doesn't break using them. The key parsing code should also stop pretending that these are always the same keys, since people could reasonable want to set up custom mappings for one but not the other when using a terminal that supports sending the CSI u sequences.

There is a little bit of trickiness here: the crossterm representation for some keypresses like Alt+Shift+J sometimes uses j (Kitty keyboard enhancement protocol) and sometimes uses J (non-enhanced). I've tried to help avoid running into issues with this difference by normalizing keys and modifiers in TerminalKey::new.

@ulyssa ulyssa merged commit 2b67740 into main Apr 24, 2024
4 checks passed
@ulyssa ulyssa deleted the duplicate-enhanced-keys branch April 24, 2024 05:11
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

Successfully merging this pull request may close these issues.

1 participant