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

turn off default prompt styling (bold) to prevent leakage #615

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

fdncred
Copy link
Collaborator

@fdncred fdncred commented Jul 31, 2023

Before this PR, the bold attribute was hard coded and therefore leaked through. Example:

Before

image
Notice that the prompt is green bold even though I told it just green. Also, when i draw the prompt with the do command, it's drawn right. This is because the do command is rendering a buffer and the PROMPT_COMMAND is going through this code in reedline and hard-coding bold everywhere.

After

image
Notice that when i tell it green, the prompt is drawn in green and with the do command. When I tell it green_bold the prompt is drawn in green_bold as well as with the do command.

This is meant to close nushell/nushell#9123 when it's implemented in nushell.

Copy link
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this styling should have no business being part of the Painter. With Prompts being also just strings as in the nushell case we should not set style here.

I think we could reconsider even the whole prompt color thing.

Before we land please keep the reset defensive.

src/painting/painter.rs Show resolved Hide resolved
@sholderbach sholderbach merged commit ed5e48e into nushell:main Jul 31, 2023
6 checks passed
@fdncred fdncred deleted the turn_off_default_styles branch July 31, 2023 19:39
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

Successfully merging this pull request may close these issues.

Prompt is bold by default
2 participants