-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues.
- Refer to the FAQ.
- Refer to Differences between Windows PowerShell 5.1 and PowerShell.
Steps to reproduce
As discussed in #18771 and #19395, which were inappropriately closed, as well as in #19101 (comment):
Note:
-
Applies to
conhost.exewindows (regular console windows on Windows) only.- Note:
- If the following manual opt-in was performed in a prior session, the problem does not occur - but this opt-in shouldn't be necessary, and wasn't up to v7.2.x:
- Having manually set the
VirtualTerminalLevelvalue in registry keyHKEY_CURRENT_USER\Consoleto1
- Having manually set the
- Conversely, this opt-in is an effective workaround, but note that it takes effect system-wide (for the current user).
- If the following manual opt-in was performed in a prior session, the problem does not occur - but this opt-in shouldn't be necessary, and wasn't up to v7.2.x:
- Note:
-
The problem is related to PowerShell's selective disabling and re-enabling of ANSI control sequences, and may be related to a recent optimization: see Use
NotifyEndApplicationto re-enable VT mode instead of doing it inInputLoop.Run#16612 -
It should be obvious that this is not a
conhost.exeproblem, given that, on an affected machine, running the same command in the current LTS version, 7.2.10, works fine. -
Implementing Consider implicitly activating VT / ANSI escape-sequence support for native programs in
conhost.execonsole windows on Windows #19101 would make this problem go away, but this opportunity was passed up.
cmd /c ver | Select-String MicrosoftExpected behavior
Microsoft Windows [Version 10.0.22621.1413]... with the word Microsoft highlighted
Actual behavior
←[7mMicrosoft←[0m Windows [Version 10.0.22621.1413]That is, the ANSI escape sequences meant to highlight the matching part of the line aren't rendered as such.
Error details
No response
Environment data
PowerShell 7.4.0-preview.2 on WindowsVisuals
No response