Skip to content

Canceling prompt is not possible in preview extension #3876

Closed
@PrzemyslawKlys

Description

@PrzemyslawKlys

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

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions