Skip to content

Coloring is not restored when using PromptText and a custom prompt #986

@JustinGrote

Description

@JustinGrote

Environment data

PS version: 6.2.2
PSReadline version: 2.0.0-beta4
os: 10.0.18941.1001 (WinBuild.160101.0800) PS file version: 6.2.2.0
BufferWidth: 120
BufferHeight: 30

Steps to reproduce or exception report

PSReadline uses the Error color with -PromptText to change color to show a syntax error, however when this reverts, it seems to reset to default colors rather than restore the prompt as it was previously.

PSReadLineIssue

Expected Behavior

Ideal: PSReadline remembers what ANSI codes were used for the characters were that it replaced and respects them. This would probably be a regex of the prompt string to find the last relevant ANSI code combinations.

Less Ideal: PSReadline doesn't seem to remember ANSI codes if they are placed in PromptText. If it did, then the coloring expected for the prompt could be defined there and "replayed" when PSReadline reverts from the error coloring.

Least Ideal: PSReadline reverts the colors to a defined option such as DefaultTokenColor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions