If the prompt-string character that is turned red to signal parser errors is colored, the color isn't restored on resolving the error.
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
On resolving the parser error, > is printed with the default foreground color rather than in green:
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:
- https://github.com/PowerShell/PowerShell/issues/21363 (should be transferred here)
- #3857
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.
- 主要言語
- C#
- スター
- 4.4k
- フォーク
- 341
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PowerShell/PSReadLine のほかの issue
-
Needs-Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
PowerShell/PSReadLine#3470 · リアクション 3 件 ·
PowerShell/PSReadLine の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
nightscout/nocturne#1425 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
Documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
難易度 2/5 1〜2日 初心者へのやさしさ 75/100
Altinn/altinn-auth#4143 ·