-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Description
After a pipeline that contains a some programs from Git for Windows (e.g., cat.exe), ANSI escape codes in the prompt are incorrectly rendered.
Steps to reproduce
- Setup a prompt function that sets the prompt to MyPrompt in green.
- Run a command that pipes data through cat.exe from Git for Windows (problem also occurs with other programs as well, but cat.exe is the simplest).
doug> function prompt { $ESC = [char]27; "$ESC[38;2;0;255;0mMyPrompt$ESC[0m>" }
MyPrompt>echo "n"| & 'C:\Program Files\Git\usr\bin\cat.exe'
n
←[38;2;0;255;0mMyPrompt←[0m>
Expected behavior
MyPrompt should be green.
MyPrompt>
Actual behavior
The prompt is white with the color codes visible.
←[38;2;0;255;0mMyPrompt←[0m>
Environment data
$PSVersionTable
Name Value
---- -----
PSVersion 7.1.0
PSEdition Core
GitCommitId 7.1.0
OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Additional Notes
This problem does not occur in Windows Powershell.
This problem occurs with Powershell Core 7.1.0 both running in Windows Terminal and running PowerShell 7 directly.
This issue was originally reported to microsoft/terminal#8525, but some investigation led me to believe the problem is in PowerShell Core, not Windows Terminal (see details of that bug for more information).
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime