reedline icon indicating copy to clipboard operation
reedline copied to clipboard

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

Open maxomatic458 opened this issue 2 years ago • 4 comments

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 https://github.com/nushell/reedline/blob/31eaeeb231664b889c92595ff38ead4ccb570766/src/painting/utils.rs#L8

see #696 for more info

maxomatic458 avatar Jan 19 '24 14:01 maxomatic458

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

ysthakur avatar Jan 19 '24 14:01 ysthakur

@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

maxomatic458 avatar Jan 19 '24 14:01 maxomatic458

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

fdncred avatar Jan 19 '24 15:01 fdncred

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.

maxomatic458 avatar Jan 19 '24 17:01 maxomatic458