Debugging hangs if script has syntax errors
See original GitHub issueSystem Details
System Details Output
### VSCode version: 1.45.1 5763d909d5f12fe19f215cbfdd29a91c0fa9208a x64
### VSCode extensions:
alefragnani.Bookmarks@11.2.0
anseki.vscode-color@0.4.5
[1589910870-8c153114-8590-4b1f-a3af-f31bcd83a35a1589910867420.zip](https://github.com/PowerShell/vscode-powershell/files/4652337/1589910870-8c153114-8590-4b1f-a3af-f31bcd83a35a1589910867420.zip)
[1589911142-471de95c-9aa2-4be8-a228-d5161deca21b1589911139246.zip](https://github.com/PowerShell/vscode-powershell/files/4652338/1589911142-471de95c-9aa2-4be8-a228-d5161deca21b1589911139246.zip)
austin.code-gnu-global@0.2.2
CoenraadS.bracket-pair-colorizer@1.0.61
DotJoshJohnson.xml@2.5.0
DougFinke.vscode-PSStackoverflow@0.0.2
Gruntfuggly.todo-tree@0.0.175
mechatroner.rainbow-csv@1.7.0
ms-vscode-remote.remote-wsl@0.44.2
ms-vscode.cpptools@0.28.0
ms-vscode.powershell@2020.4.0
ms-vscode.powershell-preview@2020.5.0
msjsdiag.debugger-for-chrome@4.12.7
nobuhito.printcode@3.0.0
oderwat.indent-rainbow@7.4.0
RandomFractalsInc.geo-data-viewer@1.9.0
tht13.html-preview-vscode@0.2.5
VisualStudioExptTeam.vscodeintellicode@1.2.7
yzhang.markdown-all-in-one@2.8.0
zovorap.ab-html-formatter@0.0.2
### PSES version: 2.1.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 7.0.1
PSEdition Core
GitCommitId 7.0.1
OS Microsoft Windows 10.0.18363
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Description
When I start a debugging session for a PowerShell script that contains a syntax error, such as:
# this script has a syntax error, I know!
@[PSCustomObject]@{
Name = Value
Name2 =
}
the session hangs.
If I manage to break it using Ctrl+C, the Terminal pane endlessly fills up with (?) prompts – see video
[Edit: with Windows PowerShell 5.1 this quickly ends with Process is terminated due to StackOverflowException.
]
This repro’s both with the release (2020.4.0) and preview (2020.5.0) versions of the PowerShell extension.
Expected Behaviour
The debugging session should report that the script has a syntax error and stop.
Actual Behaviour
The session hangs.
Attached Logs
1589910870-8c153114-8590-4b1f-a3af-f31bcd83a35a1589910867420.zip 1589911142-471de95c-9aa2-4be8-a228-d5161deca21b1589911139246.zip
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Debugging Bash Script: syntax error: unexpected end of file
Syntax errors can be debugged without executing the script, using the -n switch. Cut your program down into smaller pieces until the error ......
Read more >4. Error Handling and Debugging - VBScript in a Nutshell [Book]
If a compile-time error is encountered, an error message appears as the page is loading. This usually is the result of a syntax...
Read more >How to Perform Syntax Checking Debugging Mode in Shell ...
In the article, we will explain how to use syntax checking debugging mode in shell script to ensure that our shell scripts are...
Read more >Using Syntax Checking | Debugging Shell Scripts - InformIT
Using Syntax Checking. When dealing with any shell script, it is a good idea to check the syntax of the script before trying...
Read more >debug test is hanging #3869 - microsoft/vscode-python - GitHub
I may add some clarification too with debug behavior I witnessed in the past. Whenever I made a python syntax error if I...
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 FreeTop 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
Top GitHub Comments
@SydneyhSmith I can’t repro with either PowerShell 7.2.5 or Windows PowerShell 5.1, with version 2022.6.3 or Preview 2022.7.0 of the extension.
I’ll keep monitoring for this.
This issue has been marked as fixed. It has been automatically closed for housekeeping purposes.