-
Notifications
You must be signed in to change notification settings - Fork 819
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
Improve the method via which unsupported sequences are ignored #3800
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
But when we do so, ensure that we log what sequence was ignored if the key driver logging is enabled. The core requirement for Textualize#3742.
And by "proper ignore section" I simply mean: have the sequences we want to ignore all gathered together in a really obvious location, and with some sort of explanation.
This brings them more in line with other terminals I've tested.
Most (all?) other terminals on macOS do this anyway.
willmcgugan
reviewed
Dec 5, 2023
Rather than use the pre-existing convention of a tuple that contains Keys.Ignore, which *could* imply that a sequence maps to a set of keys that happens to include Key.Ignore, but isn't exclusive to just that, here we swap over to using a single special value for an ignored sequence.
willmcgugan
requested changes
Dec 7, 2023
willmcgugan
approved these changes
Jan 8, 2024
willmcgugan
pushed a commit
that referenced
this pull request
Jan 11, 2024
* Make ignoring keys a silent operation But when we do so, ensure that we log what sequence was ignored if the key driver logging is enabled. The core requirement for #3742. * Start a proper ignore section in the dictionary of sequences And by "proper ignore section" I simply mean: have the sequences we want to ignore all gathered together in a really obvious location, and with some sort of explanation. * Simplify opt+§ in WezTerm on macOS * Improve the wezterm opt mappings This brings them more in line with other terminals I've tested. * Tidy up the explanation for the WezTerm mappings * Ignore various ctrl-cmd- sequences from kitty * Fix a couple of incorrectly-copied sequences * Transform Ctrl+§ into 0 under kitty Most (all?) other terminals on macOS do this anyway. * Tweak some wording * Add Shift-F11 and Shift-F12 for rxvt * Switch to using a special value for ignored sequences Rather than use the pre-existing convention of a tuple that contains Keys.Ignore, which *could* imply that a sequence maps to a set of keys that happens to include Key.Ignore, but isn't exclusive to just that, here we swap over to using a single special value for an ignored sequence. * Swap to using a value as a flag, not a type #3800 (review)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR extends the current support for ignoring unsupported sequences. Until now a sequence could map to
Keys.Ignore
but this would result in an actual, bindable,<ignore>
key event being raised. Here we make the ignoring of the sequence silent, but also ensure that it gets logged tokeys.log
if the key sequence parser logging is enabled.Additionally, the PR makes a start on working through the known unhandled sequences list, either adding more aliasing for keys, or making use of the above change to ignore certain sequences altogether. In conjunction with this I've extended the code that produces the unknown sequences table so that it shows which sequences have been taken care of, and which PR took care of them. This makes it easier to keep track of what is and isn't done, and also provides a paper trail of how and why a sequence was ignored.