-
Notifications
You must be signed in to change notification settings - Fork 94
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
Adds support for alternate HOME and END escape keys #87
Conversation
Thanks, @TWithers! I've found all these documented at https://en.wikipedia.org/wiki/ANSI_escape_code, except for |
Also, do you think it's worth applying the same pattern to the arrow keys? We currently have two codes for each key (E.g. |
I found it here: https://wiki.archlinux.org/title/Home_and_End_keys_not_working#Readline |
It could be helpful and keep it simple, especially if there are more alternate keys that haven't been noticed or uncovered yet. It honestly wouldn't be a hard refactor either at this point if it is just the arrow keys that have the duplicates. Let me know if you want me to make those 2 changes ( |
My only concern with this PR is potentially breaking changes. I believe some folks have implemented their own prompts, which may depend on these constants being strings. Ordinarily, it would be straightforward to just tag Maybe we leave the arrow keys for now and we can make that refactor when we have a stronger reason to tag a new major version. |
Awesome! Sounds good to me. |
The HOME and END keys don't work on Mac in iTerm2. After searching around I found that they could be any of the following depending on the terminal type:
Rather than creating multiple
Key::Home
alternates (Home_1
,Home_2
, etc), I converted it to an array and added anoneOf()
method for the Key class to help resolve it via the existing match functions.