Skip to content

Filter empty string args to prevent node from hanging#2328

Merged
connor4312 merged 2 commits into
microsoft:mainfrom
joj:fix/filter-empty-args
Mar 10, 2026
Merged

Filter empty string args to prevent node from hanging#2328
connor4312 merged 2 commits into
microsoft:mainfrom
joj:fix/filter-empty-args

Conversation

@joj

@joj joj commented Mar 10, 2026

Copy link
Copy Markdown
Member

When "args": "" is set in launch.json, asArray("") converts it to [""] — a single-element array containing an empty string. This empty string is passed as a literal argument to node via runInTerminal, and node interprets "" as "read script from stdin", causing it to hang indefinitely with all breakpoints unbound.

Filter out empty strings from the args array before constructing the node command line.

Fixes https://developercommunity.visualstudio.com/t/10764876

joj and others added 2 commits March 10, 2026 15:43
When `"args": ""` is set in launch.json, `asArray("")` converts it to
`[""]` — a single-element array containing an empty string. This empty
string is passed as a literal argument to node via runInTerminal, and
node interprets `""` as "read script from stdin", causing it to hang
indefinitely with all breakpoints unbound.

Filter out empty strings from the args array before constructing the
node command line.

Fixes https://developercommunity.visualstudio.com/t/10764876

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@connor4312 connor4312 enabled auto-merge (squash) March 10, 2026 22:48
@connor4312 connor4312 merged commit e705d52 into microsoft:main Mar 10, 2026
2 checks passed
@connor4312 connor4312 mentioned this pull request Mar 13, 2026
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

Successfully merging this pull request may close these issues.

2 participants