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

menu/prompt indicator not rendered if it starts with a newline #707

Open
maxomatic458 opened this issue Jan 19, 2024 · 4 comments
Open

menu/prompt indicator not rendered if it starts with a newline #707

maxomatic458 opened this issue Jan 19, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@maxomatic458
Copy link
Contributor

Platform windows 10
Terminal software windows terminal

when the menu marker starts with a "\n", then the characters after that will not be shown on screen.

  1. so the following marker marker: "\nMARKER " will be rendered as \n
  2. when adding a space (or any character) in front of the marker, for example marker: " \nMARKER ", it will be fixed

Steps to reproduce

  1. make the marker of a menu start with "\n", and then trigger a completion

Screenshots/Screencaptures

  1. "\nMARKER "
    grafik
  2. " \nMARKER "
    grafik

i think its happening in this function

pub(crate) fn coerce_crlf(input: &str) -> Cow<str> {

see #696 for more info

@maxomatic458 maxomatic458 added the bug Something isn't working label Jan 19, 2024
@ysthakur
Copy link
Member

ysthakur commented Jan 19, 2024

Does this only happen for menu indicators or also prompt indicators? I see that 696 overwrote the prompt indicator with the menu indicator so it's really weird if menu indicators don't work but prompt indicators do

@maxomatic458
Copy link
Contributor Author

@ysthakur
same seems to happen with prompt indicators as well
$env.PROMPT_INDICATOR = "\nTEST" will do this
grafik

$env.PROMPT_INDICATOR = " \nTEST" will do this
grafik

@fdncred
Copy link
Collaborator

fdncred commented Jan 19, 2024

This bug has haunted me for a while. Thanks for adding an issue for it.

@maxomatic458 maxomatic458 changed the title menu indicator not rendered if it starts with a newline menu/prompt indicator not rendered if it starts with a newline Jan 19, 2024
@maxomatic458
Copy link
Contributor Author

Does this only happen for menu indicators or also prompt indicators? I see that 696 overwrote the prompt indicator with the menu indicator so it's really weird if menu indicators don't work but prompt indicators do

i just changed where its overwritten, but its overwritten anyways.

its been bugged before #696.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants