Skip to content

fix: open Zed on Windows by direct spawn instead of zed:// URL - #589

Open
Oct1AtJoe wants to merge 1 commit into
omdsh-dev:mainfrom
Oct1AtJoe:fix/zed-windows-direct-spawn
Open

fix: open Zed on Windows by direct spawn instead of zed:// URL#589
Oct1AtJoe wants to merge 1 commit into
omdsh-dev:mainfrom
Oct1AtJoe:fix/zed-windows-direct-spawn

Conversation

@Oct1AtJoe

Copy link
Copy Markdown

Problem

Zed on Windows does not correctly handle zed://file/C:/path URLs. When DSH hands such a URL to rundll32, Zed launches but refuses to open the file (os error 123 - invalid filename).

Changes

  • src/client/open-with.ts: normalizeUrlPath now uses encodeURI() to properly percent-encode spaces and special characters.
  • src/open-external.ts:
    • findZedPath: scan filesystem and PATH via fast existsSync() first; registry execSync fallback as last resort (reliable under DSH sandbox).
    • zedUrlToPath: strip zed://file/ prefix, decodeURI, remove leading slash from URL parsers (/C:/ ? C:), convert to native Windows backslashes.
    • urlCommand: on win32+zed://, spawn the discovered zed.exe with the native file path directly instead of rundll32.

Zed on Windows does not correctly handle zed://file/C:/path URLs.
When DSH hands such a URL to rundll32, Zed launches but refuses
to open the file (os error 123 - invalid filename).

Changes:
- src/client/open-with.ts: normalizeUrlPath now uses encodeURI()
  to properly percent-encode spaces and special characters.
- src/open-external.ts:
  - findZedPath: scan filesystem and PATH first via existsSync();
    registry execSync is the last resort.
  - zedUrlToPath: strip prefix, decodeURI, remove leading slash
    from URL parsers (/C:/ -> C:), normalize to Windows backslashes.
  - urlCommand: on win32+zed://, spawn the discovered zed.exe
    with the native file path directly instead of rundll32.
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.

1 participant