Skip to content

Script fails to run on second run #2319

Closed
PowerShell/PowerShellEditorServices
#1117
@DarkLite1

Description

@DarkLite1

On request of @TylerLeonhardt in #2175 I am creating this as a separate issue.

Description

When breakpoints are set in at least two other open files, the current open file (which does not contain a breakpoint) can only be executed once. Upon a second execution vscode-insders freezes.

Steps to reproduce the issue:

  1. Create 3 files:
    File1.ps1 contains code with no breakpoint (Ex. Get-Process)
    File2.ps1 contains code with a breakpoint (Ex. Start-Sleep -Seconds 1, breakpoint line 1)
    File3.ps1 contains code with a breakpoint (Ex. Start-Sleep -Seconds 1, breakpoint line 1)
  2. When all 3 files are open in the editor pane and File1.ps1 is focused press F5
    Notice that Get-Process is executed correctly and all processes are retrieved
  3. Press F5 again and notice that Get-Process is not executed, an orange bar is displayed at the bottom and the debug panel to stop debugging is floating at the top but doesn't respond to any clicks and stays there.
    image

Workarounds:

  • Close and reopen vscode-insiders to have one other successful run
  • Remove all breakpoints in all other files

System details

@rjmholt I hope you can simulate this properly now. I'm currently using PowerShell Preview 2019.11.0 and vscode-insiders:

Version: 1.41.0-insider (user setup)
Commit: 4934a6f487b9ed6b99b900ae0710c7b452792e20
Date: 2019-11-20T05:25:39.619Z
Electron: 6.1.4
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 6.2.9200

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions