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 Ctrl modifier: Ctrl-ArrowLeft/Right/Backspace #15

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

fadeevab
Copy link
Owner

Ctrl/Alt modifiers generate different escape sequences on different terminals. Alt may not work on some terminals while Ctrl works more universally. For example, Ctrl+ArrowLeft generates "\e[1;5D" sequence of 6 characters.

Ctrl/Alt modifiers generate different escape sequences on different terminals. Alt may not work on some terminals while Ctrl works more universally.
For example, Ctrl+ArrowLeft generates "\e[1;5D" sequence of 6 characters.
@fadeevab
Copy link
Owner Author

@samuela Generally, I found that initial Alt support didn't work as expected on 2 of my terminals. So, I fixed it and added Ctrl modifier, because Alt doesn't work on 1 of my terminals. They also may generate slightly different escape sequences on different terminals.

Copy link
Contributor

@samuela samuela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woo nice LGTM!

i'm wondering now if you and I were both experiencing similar issues, since I was having trouble in some terminals (iTerm), but not others (xterm.js). Hopefully this was the culprit!

I wonder if we should open an issue on https://github.com/console-rs/console with these findings? It seems to me that they should be recognizing these keyboard combos.

@fadeevab fadeevab merged commit 31517d4 into main Jan 17, 2024
@fadeevab fadeevab deleted the feature/ctrl-alt branch January 17, 2024 17:18
@fadeevab
Copy link
Owner Author

@samuela We can create an issue in the console-rs but, from what I see, they are in a "support mode" and these Ctrl/Alt things are quite hard to unify... The issue could be opend there of course...

@samuela
Copy link
Contributor

samuela commented Jan 17, 2024

oh damn, didn't realize they were in "support mode"... what's the recommended replacement?

@samuela
Copy link
Contributor

samuela commented Jan 17, 2024

Issue opened here: console-rs/console#196

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.

2 participants