Skip to content

Conversation

@lzybkr
Copy link
Contributor

@lzybkr lzybkr commented Nov 14, 2019

This PR is one possible approach to fixing #986.

It's nice in that it doesn't require adding a new configuration option - I'm thinking this would be used very infrequently.

Here is an example of how you might configure PSReadLine and an example of it working:

$esc = [char]0x1b
$pc = [char]0xe0b0
$fg = "0"
$bg = "8;2;95;158;160"
$ebg = "1"
Set-PSReadLineOption -PromptText "$esc[4${bg};3${fg}mPS$esc[4${fg};3${bg}m$pc$esc[0m","$esc[4${ebg};3${fg}mPS$esc[4${fg};3${ebg}m$pc$esc[0m"

prompt

If we go with this approach, I'll also need to update the docs.

@lzybkr
Copy link
Contributor Author

lzybkr commented Nov 14, 2019

Note that if you try my sample, you will want an powerline font installed and set the output encoding to utf8.

@daxian-dbw daxian-dbw merged commit 599e178 into master Nov 25, 2019
@daxian-dbw daxian-dbw deleted the fix_986 branch November 25, 2019 20:59
heaths added a commit to heaths/PSReadLine that referenced this pull request Dec 11, 2019
Fixes PowerShell#1243 to update documentation after PR PowerShell#1180 changed Set-PSReadLineOption -PromptText to be a String[] instead of String.

Also normalizes docs and uses escape sequence that is supported by PowerShell 5.0 (which, sadly, does not support `e or `u{}).
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.

3 participants