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

Prompt with escape sequences breaks backspace handling #168

Open
egranata opened this issue Nov 11, 2018 · 0 comments
Open

Prompt with escape sequences breaks backspace handling #168

egranata opened this issue Nov 11, 2018 · 0 comments

Comments

@egranata
Copy link

Imagine doing something like this

        prompt.append_sprintf("\x1b[38;2;205;205;0m%s\x1b[0m$ ", cwd.c_str());

in order to (in this case) color the CWD yellow in a shell prompt.

If linenoise is fed this prompt text, it will do an incorrect calculation of how many characters to move the cursor by in a refreshSingleLine() call after, e.g., pressing BACKSPACE - assuming that it needs to backspace the non-printable escape sequence characters

egranata added a commit to egranata/puppy that referenced this issue Nov 11, 2018
linenoise-mob (https://github.com/rain-1/linenoise-mob) is an actively maintained fork of linenoise.
It fixes (among probably others) antirez/linenoise#168
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

1 participant