fix: only quote paths on Windows to prevent macOS/Linux spawn() errors#156
Conversation
The path_to_quoted_string() function now only quotes paths on Windows, where the proxy uses shell mode. On Unix systems, the proxy uses spawn() with shell:false, which treats quotes as literal filename characters, causing "No such file or directory" errors. - Use runtime platform check to conditionally quote paths - Extract format_path_for_os() helper for testability - Add unit tests for Windows, Mac, and Linux behavior
|
We require contributors to sign our Contributor License Agreement, and we don't have @jkringel on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@jkringel thanks for this, we should not have missed this in the first place but luckily our community is fast to fix things. Please sign the Zed license agreement to make the CLA bot happy and we are good to go I think :) |
|
@cla-bot check |
|
We require contributors to sign our Contributor License Agreement, and we don't have @jkringel on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
Summary
Fixes a regression introduced in #151 where path quoting broke the Java extension on macOS and Linux.
Closes #155
Problem
PR #151 added double-quote wrapping to paths to fix spaces-in-path issues on Windows. However, this broke macOS and Linux because:
spawn()withshell: false, which treats quotes as literal filename charactersThis caused "No such file or directory (os error 2)" errors on macOS/Linux because the system was looking for files like
"/path/to/java"(with literal quotes in the filename).Solution
current_platform()checkformat_path_for_os()helper function for testability