Skip to content

Conversation

dzwdz
Copy link

@dzwdz dzwdz commented Aug 10, 2023

ESC [ codes always end with a char in 0x40-0x7E. Using that lets me (subjectively) simplify the handling of longer escape codes and prevent unrecognized codes from being handled as user input.

Also, since this makes adding support for new escape codes easier, I took the chance to implement Ctrl+arrows for moving between words ala readline.

dzwdz added 2 commits August 10, 2023 18:00
this:
1. prevents unknown escape sequences from leaking over as real input in some
situations
2. makes it easier to handle longer escape sequences in the future
yhirose's patch didn't make linenoiseEditDeletePrevWord() use the encoding
abstractions, so i'm being consistent here. it works with utf8 anyways

furthermore, this makes it easier to cherrypick this onto a separate branch
and send as a PR upstream
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.

1 participant