Skip to content

Editor input is not locked during debug mode #950

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
DarkLite1 opened this issue Jul 12, 2017 · 2 comments
Closed

Editor input is not locked during debug mode #950

DarkLite1 opened this issue Jul 12, 2017 · 2 comments

Comments

@DarkLite1
Copy link

DarkLite1 commented Jul 12, 2017

System Details

  • Operating system name and version: Windows Server 2012 64 bit
  • VS Code version: 1.15.0-insider
  • PowerShell extension version: 1.4.1
  • Output from $PSVersionTable:
    Name Value

PSVersion 4.0
WSManStackVersion 3.0
SerializationVersion 1.1.0.1
CLRVersion 4.0.30319.42000
BuildVersion 6.3.9600.16406
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion 2.2

Copy / paste the below commands into the PowerShell Integrated Terminal, and paste the output here

code -v
code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the pa
th is correct and try again.
At line:1 char:1
+ code -v
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS S:\Prod> $pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      4      1      0


PS S:\Prod> code --list-extensions --show-versions
code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the pa
th is correct and try again.
At line:1 char:1
+ code --list-extensions --show-versions
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Issue Description

When running a script in debug mode, put a breakpoint somewhere in the script and hit F5, it's still possible to type text in the editor. In other words, adding or changing the code in the script is allowed while the script halted at a breakpoint.

This should not be possible as it outputs strange things. To reproduce, create the following script:

[CmdLetBinding()]
Param (
    [String]$MyParam
)
 
Write-Verbose "Script started"
Get-Process | Select-Object Name
Write-Verbose "Debugging done"

Put a breakpoint on line 7 and hit F5:
image

At this point you can type something in the editor or just change Get-Process | Select-Object Name to Get-Process | Select-Object Name, ID. You will see that the debugger crashes the terminal and you are stuck with some text and no prompt:

image

The only workaround here is to close VS Code and restart it again. In PowerShell ISE the editor is correctly locked to avoid editing during debugging. This avoids issues like we experience now.

Log

logs.zip

@PowerSchill
Copy link
Contributor

All of my test systems are WMF5 so I can’t duplicate the issue. For me the script executes correctly.

@DarkLite1
Copy link
Author

Updated to WMF5.1 as you suggested. The problem is now solved. Thx :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants