Fix tsserver crashing when using custom node path#201966
Merged
mjbvz merged 4 commits intomicrosoft:mainfrom Jan 9, 2024
Merged
Fix tsserver crashing when using custom node path#201966mjbvz merged 4 commits intomicrosoft:mainfrom
mjbvz merged 4 commits intomicrosoft:mainfrom
Conversation
mjbvz
previously approved these changes
Jan 8, 2024
|
|
||
| const childProcess = execPath ? | ||
| child_process.spawn(execPath, [...execArgv, tsServerPath, ...runtimeArgs], { | ||
| child_process.spawn(`"${execPath}"`, [...execArgv, tsServerPath, ...runtimeArgs], { |
Member
There was a problem hiding this comment.
I think you should instead do JSON.stringify(execPath) which will handle quotes in the path as well.
Contributor
Author
There was a problem hiding this comment.
Nice catch! Updated and tested again on Windows/Linux.
auto-merge was automatically disabled
January 9, 2024 02:46
Head branch was pushed to by a user without write access
TylerLeonhardt
approved these changes
Jan 9, 2024
mjbvz
approved these changes
Jan 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Due to how
spawnworks, having spaces in command paths will lead it to being detected as separate arguments. Enclosing the command path in quotes allows correct working ofspawn.Fixes #201211
Tested on Windows and Linux, don't have macos machine so not able to test there.