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

Colored prompts behave incorrectly on Windows #562

Closed
acikek opened this issue Aug 28, 2021 · 2 comments
Closed

Colored prompts behave incorrectly on Windows #562

acikek opened this issue Aug 28, 2021 · 2 comments
Labels

Comments

@acikek
Copy link

acikek commented Aug 28, 2021

Using the crate ansi_term, I added color to a prompt. On my Linux machine, this works as expected. On Windows, however, the behavior is a little strange. For this example, I have an arrow prompt => colored blue.

  • Initially, the prompt is indented.
    image
  • If you hit backspace, the entered text shifts to the correct position, but the cursor stays on the right.
    image
  • From here, you can type the prompt again from the cursor positon...
    image
  • And the characters get pushed back again on backspace.
    image

I'm not sure why this is happening, or if this is an issue with rustyline or just Windows itself (this also happens on PowerShell). Any ideas?

@gwenn
Copy link
Collaborator

gwenn commented Aug 29, 2021

Do you use highlight_prompt or use only readline ?
You should use highlight_prompt.
See #215 for explanations.

@gwenn gwenn added the question label Aug 29, 2021
@acikek
Copy link
Author

acikek commented Sep 15, 2021

Did not see that, but very cool nonetheless. I think it'd be nice if it was added to the readme, that would make it a lot clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants