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

Support extended keys #3411

Closed
mistotebe opened this issue Sep 27, 2023 · 5 comments
Closed

Support extended keys #3411

mistotebe opened this issue Sep 27, 2023 · 5 comments
Labels
enhancement New feature or request Task

Comments

@mistotebe
Copy link

Several terminals support the Extended keyboard protocol which emits keys in a way that's much easier to parse. It has to be requested, but would allow textual to receive any key+modifier combination.

xterm also sends a (seemingly compatible) subset, which the specification is based on. In the longer term, this might enable keypress/release monitoring and other features, AFAIK not necessary to handle right now.

See also https://github.com/tmux/tmux/wiki/Modifier-Keys

@willmcgugan
Copy link
Collaborator

This is definitely worth looking in to. @darrenburns @davep

@davep davep added enhancement New feature or request Task labels Sep 27, 2023
@davep
Copy link
Contributor

davep commented Sep 27, 2023

Seconded. If it carries on working fine on the least-best-supported emulators but improves things in better-supported ones I really like the idea.

@Textualize Textualize deleted a comment from github-actions bot Sep 27, 2023
@darrenburns
Copy link
Member

darrenburns commented Sep 27, 2023

The protocol has a specific escape sequence for Esc so you don't need craziness to differentiate between presses of the escape key and the start of an escape sequence - wow.

(While I do think this is cool, the lack of support in Apple Terminal, Windows Terminal, and iTerm2 make me wonder how we can nicely integrate this in a way that makes it clear that these are only supported in some environments)

@willmcgugan
Copy link
Collaborator

The Extended key protocol is now supported in Textual.

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Task
Projects
None yet
Development

No branches or pull requests

4 participants