prompt: default prompt colors to the terminal foreground#1046
prompt: default prompt colors to the terminal foreground#1046iniw wants to merge 1 commit intonushell:mainfrom
Conversation
|
We've covered this in the past. If we set these to none then there are no colors for the prompt at all for reedline users unless you're using something else to color your prompt. |
|
i don't think you're right (but i'm not fully sure either!). AFAIK emitting text without a color (which is the case in this patch) will just default to the terminal's foreground color, right? so the actual color of the prompt will depend on the user's terminal emulator what i mean is that there will be colors, it just won't be controlled by reedline |
|
i understand where you're coming from but i see it the other way around: users of reedline (including the examples) should override the this is just my personal opinion, of course :) do you think me making the examples colorful again (by overriding the colors) but keeping the default color-less would be a good middle ground? |
maybe. i also wonder if we'd need to do this too in nushell when running |
pr nushell#992 reset stale sgr state before each repaint, which fixed prompt color bleed from previous command output. it did not fix the starship case reported in starship#6560 and nushell#16384 because reedline still applied its own default prompt colors immediately before printing the prompt. that meant a prompt implementation that returned ansi text without overriding `get_prompt_color()` still inherited reedline's defaults. for starship, `style = "none"` emits no color sequence at all, so the first visible character inherited reedline's green prompt color instead of the terminal's foreground color. this patch changes the default prompt, multiline, indicator, and right-prompt colors to the terminal defaults. prompts that want explicit colors can still override the color methods, but unstyled prompts now stay unstyled and no longer need an extra reset sequence to avoid the green first character.
|
okay, I've made the |
|
I think it's good. Can you look into what changes are needed in nushell to support this? |


#992 reset stale sgr state before each repaint, which fixed prompt color bleed from previous command output. it did not fix the starship case reported in starship/starship#6560 and nushell/nushell#16384 because reedline still applied its own default prompt colors immediately before printing the prompt.
that meant a prompt implementation that returned ansi text without overriding
get_prompt_color()still inherited reedline's defaults. for starship,style = "none"emits no color sequence at all, so the first visible character inherited reedline's green prompt color instead of the terminal's foreground color.this patch changes the default prompt, multiline, indicator, and right-prompt colors to the terminal defaults. prompts that want explicit colors can still override the color methods, but unstyled prompts now stay unstyled and no longer need an extra reset sequence to avoid the green first character.