Skip to content

PowerShell session crashes when ANSI escape codes are used #2176

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
pcgeek86 opened this issue Sep 14, 2019 · 10 comments
Closed

PowerShell session crashes when ANSI escape codes are used #2176

pcgeek86 opened this issue Sep 14, 2019 · 10 comments
Labels
Issue-Bug A bug to squash.

Comments

@pcgeek86
Copy link
Contributor

Issue Description

I'm trying to use ANSI escape codes in Visual Studio Code, and experiencing frequent crashes of the extension.

Write-Host -Object "$([char]27)c"
Write-Host -Object "$([char]27)invalid"

After running this 5 - 10 times, the PowerShell extension eventually crashes and requires me to manually restart it. So far, I have only tested this on the system configuration included in this bug report.

Attached Logs

Follow the instructions in the README about
capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Darwin x64 18.7.0
VSCode 1.38.0
PowerShell Extension Version 2019.5.0

PowerShell Information

Name Value
PSVersion 6.2.2
PSEdition Core
GitCommitId 6.2.2
OS Darwin 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019, root:xnu-4903.271.2~2/RELEASE_X86_64
Platform Unix
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.10032.0 6.2.2
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
LiveServer ritwickdey 5.6.1
one-monokai azemoh 0.3.7
powershell ms-vscode 2019.5.0
python ms-python 2019.9.34911
remote-containers ms-vscode-remote 0.74.0
vscode-ansible vscoss 0.5.2
vscode-icons vscode-icons-team 9.3.0
@ghost ghost added the Needs: Triage Maintainer attention needed! label Sep 14, 2019
@rjmholt
Copy link
Contributor

rjmholt commented Sep 15, 2019

@pcgeek86 are you able to include any information about how the extension crashes? Can you please attach your logs.

@pcgeek86
Copy link
Contributor Author

@rjmholt I just sent the diagnostic logs to the vscode-powershell alias. Here's a screenshot of what I'm seeing when it crashes.

Screen Shot 2019-09-15 at 5 46 00 PM

@SydneyhSmith
Copy link
Collaborator

@pcgeek86 thanks for the screenshot! I did not see the logs searching through our mail, did you send them to [email protected]? Thanks!

@SydneyhSmith SydneyhSmith added Needs-Repro-Info and removed Needs: Triage Maintainer attention needed! labels Sep 20, 2019
@pcgeek86
Copy link
Contributor Author

Hello @SydneyhSmith, yes I did send them to that address on September 15th. I just reproduced the issue again and sent a fresh copy though. Please confirm receipt!

@rjmholt
Copy link
Contributor

rjmholt commented Sep 23, 2019

Ah, now I've seen it with highlighting, my suspicion is that this is a crash I've seen happen with any subexpression in a string

@ghost
Copy link

ghost commented Sep 29, 2019

This issue is being closed as inactive, if this issue is still occurring it will be re-opened

@ghost ghost added the Resolution-Inactive Will close automatically. label Sep 29, 2019
@ghost ghost closed this as completed Sep 29, 2019
@pcgeek86 pcgeek86 reopened this Sep 29, 2019
@pcgeek86
Copy link
Contributor Author

This isn't inactive. It's pending a resolution. The bot shouldn't be closing issues that haven't been addressed.

Have you found anything further with subexpressions in strings @rjmholt?

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Sep 29, 2019
@SydneyhSmith SydneyhSmith added Issue-Bug A bug to squash. and removed Resolution-Inactive Will close automatically. labels Sep 30, 2019
@rjmholt
Copy link
Contributor

rjmholt commented Oct 1, 2019

I just tried making this happen in all the various ways:

  • Writing a subexpression
  • Using an ANSI code
  • Both of the above while debugging

I wasn't able to reproduce the issue though.

It might be worth trying out preview and seeing if the problem is fixed there.

From your logs it looks like this occurred while debugging and our next preview release should have some improvements there.

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Oct 7, 2019
@pcgeek86
Copy link
Contributor Author

pcgeek86 commented Oct 9, 2019

I've tried the PowerShell 7 preview, and even built some content around it, but haven't tried upgrading my development environment yet. Maybe I'll see if I can repro with VSCode devcontainers, although I don't want to introduce too many variables.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Oct 9, 2019
@pcgeek86 pcgeek86 closed this as completed Oct 9, 2019
@rjmholt
Copy link
Contributor

rjmholt commented Oct 10, 2019

Hmmm, I just looked through the logs again and it looks like the only unhandled error there is a debugger crash.

That debugger crash has been fixed variously in:

But I do remember seeing a similar crash to the one you report at some point, so let us know if you're hitting it still.

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

3 participants