console-rs / console-rs/console
Alt+{left, right, backspace} are not properly recognized
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.2k
- Forks
- 144
- Avg merge
- 8h 24m
- Merged PRs (30d)
- 4
Description
As discovered in https://github.com/fadeevab/cliclack/pull/15 and https://github.com/fadeevab/cliclack/pull/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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with cliclack/src/prompt/interaction.rs, especially the workaround around lines 116-146, and compare its handling with console-rs input parsing. Trace the listed ANSI sequences for Alt+left, Alt+right, and Alt+backspace, then verify that console-rs recognizes them consistently across the affected terminal inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100