Skip to content

Would you consider supporting PowerLine-like custom prompts? #1997

@springcomp

Description

@springcomp

I’m a big fan of Oh My Posh custom prompts and have customized my PSRL PromptText and ContinuationPromptText options like so:

Set-PSReadLineOption -ContinuationPrompt "`e[48;2;88;88;88m `e[0m`e[38;2;88;88;88m$([char]0xE0B0)`e[0m "
Set-PSReadLineOption -PromptText "`e[38;2;88;88;88m$([char]0xE0B0)`e[0m "

Looks a bit barbarian but it gives me a nice prompt like this:

image

Description of the new feature/enhancement

The problem with customizing the PromptText option with ANSI escape sequences is that this prevents the default processing in RenderErrorPrompt behaviour to kick in. It would be awesome if PSRL would behave like this:

PowerShell 7 Preview 2020-11-29 18-13-41

Proposed technical implementation details (optional)

I would like to propose an additional option named ErrorPromptText that could be customized.
If set to a particular value, it would take precedence over PromptText being rendered in red and would be written as is.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions