Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tsserver no longer crashes when log path includes spaces #212752

Merged

Conversation

walkerdb
Copy link
Contributor

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 named Application 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.

@mjbvz mjbvz added this to the May 2024 milestone May 21, 2024
@mjbvz mjbvz enabled auto-merge (squash) May 21, 2024 17:35
@mjbvz
Copy link
Contributor

mjbvz commented May 21, 2024

Thanks!

@mjbvz mjbvz merged commit 3bda9ff into microsoft:main May 21, 2024
6 checks passed
@walkerdb walkerdb deleted the walker.fix-tsserver-logs-when-path-has-spaces branch May 21, 2024 18:02
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.

TSServer does not print logs when custom node is used
3 participants