Repository navigation
Conversation
On Windows, Zed's stable, Preview and Nightly channels each install a `zed` CLI in their own folder, so choosing "Zed" opened whichever came first on PATH. Generic Zed on Windows now prefers the first PATH install whose own folder does not name a prerelease channel, and launches it by absolute path when it is not the first match. The PATH walk is shared with resolveCommandPath. Selection rule from pingdotgg#9501 by EzraBuild. Fixes pingdotgg#1978. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A user or parent folder such as `zedpreview` matched the prerelease check, so stable Zed under it counted as prerelease and PATH order won again. The channel now comes from the nearest folder naming Zed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped Windows Zed resolution fix that selects stable Zed when a prerelease executable appears first on PATH, while preserving existing behavior for other editors and single-install cases. The shared PATH refactor retains the prior first-match semantics and is covered by targeted tests. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Written by updated the original branch at
unverified: native windows launch and browser-to-windows integration on this linux vm. the original windows evidence remains in the description; i have not reproduced it here. coderabbit's automatic update hit its review limit, so its earlier approval does not cover this head. the remaining maintainer decision is unchanged: should generic "zed" prefer stable when preview or nightly comes first on path? this branch implements stable-first. it preserves command-name launch when the preferred install is already first, and falls back to prerelease when stable is absent. |
|
Note Written by Verified in a real dev environmentchecked
short runtime transcript: pr linux editor picker and shortcut interaction, seven seconds. playback and seeking checked after upload: real codex response and terminal output on the exact pr head: Not verifiedthe changed behavior is windows-only. this vm cannot reproduce main opening windows preview/nightly ahead of stable or prove the pr selects stable on windows. stable-first, prerelease-only fallback, native windows process creation, and windows paths containing spaces remain unverified through a native client/server flow. the original contributor's windows captures were not reproduced here. macos, electron, and native ios/android were not exercised. linux zed opened the project but displayed first-run keyring and software-gpu dialogs. i left the keyring untouched, so full editor usability is unverified. this screenshot records that limit: the first pr startup briefly selected the root checkout's shared home; i stopped it when the startup log revealed that and restarted with explicit result: unverifiable for the windows fix on this linux vm. the exercised linux paths passed. no claim that passing tests or ci proves the fix works on windows. media limitation: git.cafe renders these external media embeds as text links. i opened the uploaded files directly and verified both images and video playback/seeking. its native attachment upload returned http 409 ( |
|
Note 🤖 Opus 5.5 replying on behalf of Victor. @maria-rcks, main now conflicts with this branch in
What it changes:
Verification on
What it doesn't settle: whether generic "zed" should prefer stable, which is still your call. I didn't re-run the native Windows check, and nothing on screen changes. Happy to push it to this PR's branch if you'd like. |


Problem
On Windows with stable Zed and Zed Nightly or Zed Preview installed side by side, choosing "Zed" opens whichever install comes first on PATH. Each channel installs its own
zedCLI in its own folder (Programs\Zed\bin,Programs\Zed Preview\bin), and editor resolution takes the firstzedit finds. The workaround is reordering PATH or uninstalling Nightly.Fixes https://git.cafe/pingdotgg/t3code/issues/1978.
Change
editor.ts: on Windows, generic Zed now lists every PATH match forzedandzeditorand picks the first one whose install folder does not name a prerelease channel. The install folder is the nearest folder above the CLI that names Zed (Zed,Zed Preview,Zed Nightly), so a user or parent folder further up, such aszedpreview, does not mark stable Zed as prerelease.shell.ts: the PATH walk insideresolveCommandPathmoves into a helper that stops at the first match or returns all of them.resolveCommandPathkeeps its cache and behavior. The newresolveCommandPathsuses the same walk and directory listing cache, and caches no results.Zed.appbundle over PATH, and the issue is Windows-only.Scope and approval
This needs maintainer approval of the selection rule before it can merge. Julius's triage on https://git.cafe/pingdotgg/t3code/issues/1978 reproduced the bug on main and left open how the generic Zed entry should pick a channel when several are installed. https://git.cafe/pingdotgg/t3code/pulls/9501 made this same fix and was closed for missing that decision, not on its merits.
This PR implements one answer: generic "Zed" means stable, so a stable install beats a Nightly or Preview one earlier on PATH. Other options are keeping PATH order (closing the issue as intended) or separate "Zed Nightly" and "Zed Preview" entries. I'm opening it so the rule can be decided against working code, and will rework or close it if you pick another.
Open https://git.cafe/pingdotgg/t3code/pulls/23416 edits the same block in
editor.tsfor Linux. Neither PR changes the other's platform, so whichever merges second needs a small rebase.Verification
externalLauncher.test.tsfor Zed Nightly and Zed Preview, through the realExternalLauncherwith the Windows platform service and real files under a user folder namedzedpreview. With the prereleasebinfirst on PATH, stable must launch by absolute path; with stable removed, the prerelease install must still open by name. On the base commit both cases fail: the launcher spawnszed, the prerelease install.Test run on the base commit with the new tests.
Test run on this branch.
vp test run src/process/externalLauncher.test.ts: 22 passed.vp test run src/shell.test.tsinpackages/shared: 40 passed, 2 skipped.vp lintandvp fmt --checkon the three changed files, andvp run --filter @t3tools/shared --filter t3 typecheck: pass.binfirst on PATH: I built the Windows CLI archive (t3.exeplus the web client) from this branch, andt3.exefrom the base commit; this PR changes no client code. For each, I rant3 serve, added a folder as a project in Edge, and clicked Open in Zed. The base commit opened the folder in Zed Preview; this branch opened it in stable Zed. Each capture shows the click and the About dialog of the Zed that opened.Windows 11, T3 Code server built from the base commit.
Windows 11, T3 Code server built from this branch.
externalLauncher.tsranExternalLauncher.launchEditor({ editor: "zed" })with Node's real spawner and logged each spawn:Programs\Zed Preview\bin\zed.EXEon the base commit,Programs\Zed\bin\zed.EXEon this branch.Not checked:
zeditoralias. The rule covers both names either way.zedstill wins over an earlierzeditor, the shape Julius's fixture on https://git.cafe/pingdotgg/t3code/issues/1978 showed. Nothing in those paths says which install is stable, so this PR leaves that order alone.zedis on PATH, as before.Prior PRs
resolveCommandPathinstead of copying it, and keeps one test in the existing launcher test file.Generated with Claude Opus 5.5 in T3 Code Nightly
Fixes #1978