Skip to content

Canceling prompt is not possible in preview extension #3876

Closed

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

When you use mandatory parameters and it prompts you to enter value it's impossible to cancel it with CTRL+C or SHIFT+F5. You need to go thru the whole process and then it stops.

function Test-Me {
    [cmdletBinding()]
    param(
        [Parameter(Mandatory = $true)] $Test
    )
}

Test-Me

Same thing applies to Read-Host

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.65.2
c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
x64

Extension Version

Steps to Reproduce

  1. Run any command that has mandatory parameters
  2. Try to cancel it
  3. Alternatively try with Read-Host
  4. Try to cancel it

Visuals

No response

Logs

No response

Activity

  1. ghost added
    Needs: Triage
    on Mar 15, 2022
  2. andyleejordan commented on Mar 16, 2022

    @andyleejordan
    Member

    Thanks Przemysław Kłys (@PrzemyslawKlys)! I'm planning to look into this tomorrow.

  3. andyleejordan commented on Mar 17, 2022

    @andyleejordan
    Member

    This is not reproducing for me with PowerShell 7.2 on neither macOS nor Windows 11.

  4. andyleejordan commented on Mar 17, 2022

    @andyleejordan
    Member

    Hm, it's also not reproducing with Windows PowerShell 5.1 for me either.

  5. andyleejordan commented on Mar 17, 2022

    @andyleejordan
    Member

    Yeah, I can't repro this at all. Not with the latest released preview (nor master) on Windows nor Mac with 5.1 nor 7.2, neither running Test-Me in the IC by itself nor from running it via F5 in the script, even with a breakpoint set.

    Can you find a more specific way to repro this?

  6. moved this from Todo to In Progress in Sea Biscuiton Mar 17, 2022
  7. andyleejordan commented on Mar 17, 2022

    @andyleejordan
    Member
    > $PSVersionTable
    
    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
    
  8. andyleejordan commented on Mar 17, 2022

    @andyleejordan
    Member

    Funny thing though: executing Read-Host directly in the IC just loops into a PSReadLine stacktrace over and over, but that's a separate bug 😆

  9. 23 remaining items

  10. added
    Resolution-External
    and removed
    Needs: Fix Verification
    on Apr 13, 2022
  11. andyleejordan commented on Apr 13, 2022

    @andyleejordan
    Member

    Just be very clear that it repros in standard PowerShell terminals in VS Code, no extension required!

  12. PrzemyslawKlys commented on Apr 13, 2022

    @PrzemyslawKlys
    ContributorAuthor

    But it doesn't repro for you... so maybe some of my settings is affecting this.

  13. SeeminglyScience commented on Apr 13, 2022

    @SeeminglyScience
    Collaborator

    But it doesn't repro for you... so maybe some of my settings is affecting this.

    Try enabling Developer: Toggle Keyboard Shortcuts Troubleshooting, selecting the terminal panel, pressing Ctrl + C and the go back to Output. See what you have there

    Here's mine for instance:

    image

  14. PrzemyslawKlys commented on Apr 13, 2022

    @PrzemyslawKlys
    ContributorAuthor

    image
    image

  15. SeeminglyScience commented on Apr 13, 2022

    @SeeminglyScience
    Collaborator

    What about "terminal.integrated.windowsEnableConpty": true, you got that on?

  16. SeeminglyScience commented on Apr 13, 2022

    @SeeminglyScience
    Collaborator

    Also the original issue says 5.1, can you check if 7 has the same behavior?

  17. PrzemyslawKlys commented on Apr 13, 2022

    @PrzemyslawKlys
    ContributorAuthor

    I have it disabled "terminal.integrated.windowsEnableConpty": false, after enabling it ---> IT WORKS!

  18. PrzemyslawKlys commented on Apr 13, 2022

    @PrzemyslawKlys
    ContributorAuthor

    I had it disabled based on: #2377

  19. SeeminglyScience commented on Apr 13, 2022

    @SeeminglyScience
    Collaborator

    WOOT

    Yeah conpty solves a lot of input related issues. Even when that bug was still going I just grit my teeth through it as it's fixes were worth the very frustrating bug. I forgot all about that... that was rough 😁

  20. PrzemyslawKlys commented on Apr 13, 2022

    @PrzemyslawKlys
    ContributorAuthor

    Thank you guys! Sorry for this false bug report.

  21. andyleejordan commented on Apr 13, 2022

    @andyleejordan
    Member

    It wasn't false! Something was buggy, and I'm glad Patrick Meinecke (@SeeminglyScience) knew what was up, woo 🥳

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

Metadata

Metadata

Labels

Area-Extension TerminalIssue-BugResolution-External

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions