Skip to content

PowerShell session crashes when ANSI escape codes are used #2176

Closed

Description

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

Activity

  1. ghost added
    Needs: Triage
    on Sep 14, 2019
  2. rjmholt commented on Sep 15, 2019

    @rjmholt
    Contributor

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

  3. pcgeek86 commented on Sep 16, 2019

    @pcgeek86
    ContributorAuthor

    Rob Holt (@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

  4. SydneyhSmith commented on Sep 20, 2019

    @SydneyhSmith
    Collaborator

    Trevor Sullivan (@pcgeek86) thanks for the screenshot! I did not see the logs searching through our mail, did you send them to vscode-powershell@microsoft.com? Thanks!

  5. added and removed
    Needs: Triage
    on Sep 20, 2019
  6. pcgeek86 commented on Sep 23, 2019

    @pcgeek86
    ContributorAuthor

    Hello Sydney Smith (@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!

  7. rjmholt commented on Sep 23, 2019

    @rjmholt
    Contributor

    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

  8. ghost added
    Resolution-Inactive
    on Sep 29, 2019
  9. ghost closed this as completedon Sep 29, 2019
  10. pcgeek86 commented on Sep 29, 2019

    @pcgeek86
    ContributorAuthor

    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 Rob Holt (@rjmholt)?

  11. ghost added
    Needs: Maintainer Attention
    on Sep 29, 2019
  12. added
    Issue-Bug
    and removed
    Resolution-Inactive
    on Sep 30, 2019
  13. rjmholt commented on Oct 1, 2019

    @rjmholt
    Contributor

    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.

  14. pcgeek86 commented on Oct 9, 2019

    @pcgeek86
    ContributorAuthor

    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.

  15. ghost added
    Needs: Maintainer Attention
    on Oct 9, 2019
  16. rjmholt commented on Oct 10, 2019

    @rjmholt
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions