Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

If the prompt-string character that is turned red to signal parser errors is colored, the color isn't restored on resolving the error.

Offen
#4,716 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
csharp, powershell
Bereich
cli

Rechercherichtung

No source file or test is named. Start by reproducing the issue with the provided prompt and quote sequence, then trace PSReadLine's prompt parsing and rendering of ANSI-colored characters. Done means the green > is restored after the parser error is resolved, with regression coverage for the reported behavior.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Needs-Triage :mag:
Prerequisites
  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.
Exception report
N/A
Screenshot
Image

On resolving the parser error, > is printed with the default foreground color rather than in green:

Image
Environment data
PS Version: 7.6.0-preview.3
PS HostName: ConsoleHost
PSReadLine Version: 2.3.6
PSReadLine EditMode: Emacs
OS: Darwin MacBook-Pro.local 24.4.0 Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:47 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T6000 arm64
BufferWidth: 180
BufferHeight: 60
Steps to reproduce

Define the following prompt, which prints foo followed by a green > char. (and a space):

function prompt { "foo$($PsStyle.foreground.Green)>$($PSStyle.Reset) " }

Type a single quote character, which provokes a parser error and turns the > red.

Type a closing quote to resolve the parser error.


Presumably related:

Expected behavior

On resolving the parser error, the > should be restored with its original color, i.e. green.

Actual behavior

On resolving the parser error, the > is restored with the default foreground color.

Note that using PSReadLine seemingly does recognize the > despite being surrounded by ANSI escape sequences, but makes no attempt to preserve its color.

Note that trying something like Set-PSReadLineOption -PromptText "$($PsStyle.foreground.Green)>$($PSStyle.Reset) " does not help - PSReadLine doesn't recognize it as part of the prompt string.

Vorherrschende Sprache
C#
Sterne
4.4k
Forks
341
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PowerShell/PSReadLine

Alle Issues in PowerShell/PSReadLine

Ähnliche Issues

Weitere Issues zu C#

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.