fix: tsserver no longer crashes when log path includes spaces #212752
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.
Guarantees that the log and trace filepaths passed into tsserver are wrapped in double quotes. Fixes #204678
Today on macOS the default log path will be something like
/Users/xxx/Library/Application Support/Code/logs/20240207T135733/window4/exthost/vscode.typescript-language-features/tsserver-log-2o1bl4/tsserver.log
- note it's in a folder namedApplication Support
.When we don't wrap the path in double quotes then bash interprets the log path as being
/Users/xxx/Library/Application
, with the remaining part of the args just being extra stuff that the server command gets confused about.I don't think we need to worry about the
logFilePath.fsPath
value already having double quotes in it since it's already a processed filepath with escapes in place for unexpected characters, but I'd be happy to add more protection against extra double quotes if that's something folks are concerned about.