Skip to content

Adding color for prompt text - #653

Merged
Jason Shirk (lzybkr) merged 1 commit into
PowerShell:masterfrom
powercode:promptcolor
Mar 23, 2018
Merged

Jason Shirk (lzybkr) merged 1 commit into
PowerShell:masterfrom
powercode:promptcolor

Conversation

@powercode

Copy link
Copy Markdown
Contributor

When the promt is drawn with a different
color than the default text, it renders ugly when
we set it back to another color than what was
originally set.
prompt

@lzybkr

Copy link
Copy Markdown
Contributor

Did you try adding the color to PromptText, like this?

Set-PSReadLineOption -PromptText "$e[96m>"

@powercode

Copy link
Copy Markdown
Contributor Author

Ah, clever :)

@powercode

Copy link
Copy Markdown
Contributor Author

Almost clever :)
That changes the length of the prompt text, so we change color 5 characters behind the prompt text.

@lzybkr

Jason Shirk (lzybkr) commented Mar 21, 2018 •

Copy link
Copy Markdown
Contributor

I'm not a fan of excessive options.

What do you think about fixing PromptText to ignore color escape sequences? PowerShell does this here - though I think that code doesn't handle CJK correctly - I think this PR fixes that.

@powercode

Copy link
Copy Markdown
Contributor Author

The fewer options the better for sure!
I'll take a look.

@powercode

Copy link
Copy Markdown
Contributor Author

prompt2

When the promt is drawn with a different
color than the default text, it renders ugly when
we set it back to another color than what was
originally set.

@lzybkr Jason Shirk (lzybkr) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix,

I was actually hitting the same issue in my personal admin prompt, but too busy to give it any thought so I appreciate you taking care of it.

@lzybkr
Jason Shirk (lzybkr) merged commit 03c4899 into PowerShell:master Mar 23, 2018
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.

2 participants