Script fails to run on second run
See original GitHub issueOn 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:
- Create 3 files:
File1.ps1contains code with no breakpoint (Ex.Get-Process)File2.ps1contains code with a breakpoint (Ex.Start-Sleep -Seconds 1, breakpoint line 1)File3.ps1contains code with a breakpoint (Ex.Start-Sleep -Seconds 1, breakpoint line 1) - When all 3 files are open in the editor pane and
File1.ps1is focused pressF5Notice thatGet-Processis executed correctly and all processes are retrieved - Press
F5again and notice thatGet-Processis 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.
Workarounds:
- Close and reopen
vscode-insidersto 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Cannot run the second script / bash from the first ...
But here come out my problem, if I will try to run it the Python app will run perfectly but the script will...
Read more >Script fails in second iteration
Vuser init - Launch and Login Action - Search Vuser end - Logout first iteration is working fine. It started throwing error message...
Read more >Why is my Apple Script not running twice?
Yoru script fails on second runs because you completely b0rk the code :) Consider the following part of your code: on isFolder(folderAlias) set ......
Read more >Bash - run one script when previous is sucessful else ...
report_failure.sh. How can I do something like this pseudo-code does: if (main_script.sh finished without error): run report_success.
Read more >How do I run multiple scripts within a script, even if one ...
The problem is, if the first command (or second) dies with an error, none of the subsequent commands are run. Is there a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@TylerLeonhardt I dumped the artifacts from the build: https://dev.azure.com/powershell/PowerShellEditorServices/_build/results?buildId=39793 into my extensions module folder, and @SeeminglyScience’s fix so far seems to be working for me. I ran it thru about 10-15 times and looking good so far. I’ll stress test it tomorrow during development.
@SeeminglyScience has a fix out for this. @SeeminglyScience if you wanna provide a test vsix for these folks, feel free to upload one.