Skip to content

Commit 82a2514

Browse files
maria-rcksclaude
andcommitted
fix(editors): only drop the verified C: drive in Zed remote links
Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent 18f41e0 commit 82a2514

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/contracts/src/editor.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ export const buildRemoteOpenUrl = (input: {
122122
const encodedHost = encodeURIComponent(input.host);
123123
if (input.editor === "zed") {
124124
// Zed's remote server resolves a rooted path on the system drive, so a
125-
// Windows `/C:/Users/x` must become `/Users/x` (verified in #8938).
126-
const zedPath = rootedPath.replace(/^\/[A-Za-z]:(?=\/|$)/, "");
125+
// Windows `/C:/Users/x` must become `/Users/x` (verified in #8938). Other
126+
// drives are untested and kept as is rather than silently remapped.
127+
const zedPath = rootedPath.replace(/^\/[Cc]:(?=\/|$)/, "");
127128
const encodedZedPath = zedPath.split("/").map(encodeURIComponent).join("/");
128129
return `${scheme}://ssh/${encodedHost}${encodedZedPath || "/"}`;
129130
}

0 commit comments

Comments
 (0)