console-rs/console

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

Opened this issue · 1 comments

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.

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.