fix(open-in-apps): Improve Windows compatibility and command handling#2081
fix(open-in-apps): Improve Windows compatibility and command handling#2081anglox wants to merge 2 commits into
Conversation
Greptile SummaryThis PR improves Windows compatibility for the "Open in App" feature by replacing
Confidence Score: 5/5Safe to merge — all previously identified issues are addressed and no new defects were found. The conditional No files require special attention.
|
| Filename | Overview |
|---|---|
| src/main/core/app/utils.ts | Adds platform-conditional command detection: where on Windows, command -v on POSIX. Correct and minimal — where.exe is always available in System32 on Windows, and the callback only checks the exit code so uncaptured stdout from where is harmless. |
| src/main/core/app/service.ts | Adds 'zed' to the remote-SSH URL-builder branch (fixing the previous "not yet implemented" fallthrough) and introduces platform-aware quoted() — POSIX single-quote escaping vs CMD-style "" double-quote escaping on Windows. |
| src/main/utils/remoteOpenIn.ts | Extends RemoteEditorScheme with 'zed' and adds a switch arm in buildRemoteEditorUrl that emits zed://ssh/<authority>/<path> rather than the VS Code vscode-remote scheme. |
| src/shared/openInApps.ts | Removes start "" <app> wrappers from all Windows openCommands entries, marks Zed as supportsRemote: true, and adds a win32 platform block for Zed. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[openInApp] --> B{Has URL schemes?}
B -- Yes --> C[shell.openExternal URL]
B -- No --> D[Build quoted path]
D --> E{platform}
E -- win32 --> F[double-quote with CMD escaping]
E -- posix --> G[single-quote with POSIX escaping]
F & G --> H[Replace path in openCommands]
H --> I[exec command]
J[openInRemote] --> K{appId}
K -- vscode/vscodium/cursor/zed --> L[buildRemoteEditorUrl]
L --> M{scheme}
M -- zed --> N[zed://ssh/authority/path]
M -- default --> O[scheme://vscode-remote/ssh-remote+authority/path]
N & O --> P[shell.openExternal]
Q[checkCommand] --> R{platform}
R -- win32 --> S[exec: where cmd]
R -- non-win32 --> T[exec: command -v cmd]
S & T --> U[resolve by exit code]
Reviews (3): Last reviewed commit: "fix(open-in-apps): platform-aware check ..." | Re-trigger Greptile
This PR improves cross-platform reliability of the “Open in App” system, with a focus on fixing Windows execution issues and aligning command resolution behavior across platforms.
command -vand Windows-compatiblewherestart ""wrappers in favor of direct executable callszed://ssh/...scheme handling for remote SSH pathsIssues addressed: