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

Alt+{left, right, backspace} are not properly recognized #196

Open
samuela opened this issue Jan 17, 2024 · 1 comment
Open

Alt+{left, right, backspace} are not properly recognized #196

samuela opened this issue Jan 17, 2024 · 1 comment

Comments

@samuela
Copy link

samuela commented Jan 17, 2024

As discovered in fadeevab/cliclack#15 and fadeevab/cliclack#9, console-rs does not recognize common ANSI escape sequences such as '\u{7f}', 'b', 'f', '[1;3D', '[1;5D', '[1;3C', '[1;5C' which correspond variously to Alt+{left, right, backspace} on common terminals.

See https://github.com/fadeevab/cliclack/blob/31517d4188f4a27a38e83afa79c9a627d24f4c50/src/prompt/interaction.rs#L116-L146 for how we worked around this in cliclack.

It would be great if these common ANSI escape sequences could be parsed and recognized by console-rs.

@mitsuhiko
Copy link
Collaborator

I think this should be improved, but adding that support will break people who are currently falling into the UnknownEscSeq branch. Might be quite invasive to change that.

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

No branches or pull requests

2 participants