console-rs / console-rs/console

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

Open
#196 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.