Skip to content

Pressing CTRL+C to cancel script doesn't stop debugging in preview extension #3700

Closed
PowerShell/PowerShellEditorServices
#1685

Description

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all 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.

Summary

I just installed preview extension to see if Write-Host is fixed yet, and noticed it wasn't, so during a long time script running I press CTRL+C, but while the script stopped, GUI doesn't think so.

image

PowerShell Version

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

Visual Studio Code Version

1.62.3
ccbaa2d27e38e5afa3e5c21c1c7bef4657064247
x64

Extension Version

ironmansoftware.powershell-universal@2.5.0
ms-vscode.powershell@2021.10.2
ms-vscode.powershell-preview@2021.11.1
tobysmith568.run-in-powershell@1.1.1
TylerLeonhardt.vscode-inline-values-powershell@0.0.5

Steps to Reproduce

  1. Run a script
  2. CTRL+C the script
  3. Notice how debugging is still on

Visuals

No response

Logs

No response

Activity

  1. ghost added
    Needs: TriageMaintainer attention needed!
    on Nov 23, 2021
  2. andyleejordan commented on Nov 23, 2021

    @andyleejordan
    Member

    Przemysław Kłys (@PrzemyslawKlys) Can you link the tracking issue for "Write-Host is fixed yet, and noticed it wasn't"?

  3. andyleejordan commented on Nov 23, 2021

    @andyleejordan
    Member

    Also can you test if this repros with PowerShell 7.2? While I wired up a stop debugging notification so that stopping the PowerShell debugger informs Code to stop the GUI, I don't think it is supported with PowerShell 5.1

  4. PrzemyslawKlys commented on Nov 23, 2021

    @PrzemyslawKlys
    ContributorAuthor

    It's not only PowerShell 5.1

    image

    Notice how I stopped CTRL+C and was able to type stuff in a terminal, while the GUI was showing something different.

    I refuse to use preview until this is fixed because it ruins the output of my programs. My modules heavily rely on Write-Host and it makes it really bad.

    image

  5. andyleejordan commented on Nov 23, 2021

    @andyleejordan
    Member

    Cool, thanks for the information.

  6. andyleejordan commented on Nov 23, 2021

    @andyleejordan
    Member

    It looks like the wiring up I did in PowerShell/PowerShellEditorServices#1570 was unfortunately not carried over in the pipeline threading rewrite PowerShell/PowerShellEditorServices#1459.

  7. moved this from Todo to In Progress in Sea Biscuiton Jan 27, 2022
  8. Repository owner moved this from In Progress to Done in Sea Biscuiton Jan 27, 2022
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

    Type

    No type

    Projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions