Skip to content

Command decoration indicates success (blue dot) if the command failed (exit code > 0) #4854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
6 tasks done
insaneinvader opened this issue Dec 6, 2023 · 5 comments · Fixed by PowerShell/PowerShellEditorServices#2125
Assignees

Comments

@insaneinvader
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

It appears that the PowerShell extension confuses VSCode terminal decorations.

Left - using VSCode integrated PowerShell terminal - a red dot appears to indicate that the command failed.
Right - using PowerShell Extension terminal - a blue dot appears to indicate that the failed command was successful.
img

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.22621.2506
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2506
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Name             : Visual Studio Code Host
Version          : 2023.8.0
InstanceId       : 8e54ba22-67da-47b2-b060-3887d7a8ce58
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : pl-PL
CurrentUICulture : en-GB
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.84.2
1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
x64

Extension Version

Steps to Reproduce

Execute throw "foo"

Visuals

No response

Logs

No response

@insaneinvader insaneinvader added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Dec 6, 2023
@andyleejordan
Copy link
Member

@Tyriar hm, any change recently to the escape codes used by shell integration? I'll do a diff here soon and update what's embedded in PSES. I wonder if this is probably us having an extra catch instead though.

@Tyriar
Copy link
Contributor

Tyriar commented Dec 7, 2023

The only recent change I can think of is the introduction of a nonce to verify the command name. This is optional and should not affect the exit code though

@insaneinvader
Copy link
Author

Hope this helps:
v2023.1.0 - blue dot regardless of exit code - bad
v2022.12.1 - red|blue dot decoration works - OK
v2022.11.0 - no decorations - no feature, no bug

@andyleejordan
Copy link
Member

@insaneinvader that helps a lot actually, thank you! Looking at this now.

@andyleejordan
Copy link
Member

Yup, figured it out. We broke it when we added Set-StrictMode above where we save the exit code. Fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants