The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 14:45 UTC
fix(editors): Open in Zed no longer finds the ZFS event daemon (#33461)
Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Daniel Dewhurst committed
Nov 14, 2026 at 16:28 UTC
b779d400777c8366cce13456a305054b2cca42cd
2 files changed
+38
-16
apps/server/src/process/externalLauncher.test.ts
+21
-6
@@ -796,17 +796,32 @@ it.effect.skipIf(windowsHost)("does not offer the OpenZFS zed daemon as Zed on L
796
);
797
yield* fs.chmod(zfsZed, 0o755);
798
const editor = EDITORS.find((editor) => editor.id === "zed")!;
799
- const resolve = resolveEditorCommand(editor, { HOME: home, PATH: binDir }).pipe(
800
- Effect.provideService(HostProcess.Platform, "linux"),
801
- Effect.provideService(Path.Path, withSystemBin(path, systemBin)),
802
- );
803
- assert.deepEqual(yield* resolve, Option.none());
799
+ const laterBin = path.join(home, "later-bin");
800
+ const resolveOn = (platform: NodeJS.Platform) =>
801
+ resolveEditorCommand(editor, { HOME: home, PATH: `${binDir}:${laterBin}` }).pipe(
802
+ Effect.provideService(HostProcess.Platform, platform),
803
+ Effect.provideService(Path.Path, withSystemBin(path, systemBin)),
804
+ );
805
+ assert.deepEqual(yield* resolveOn("linux"), Option.none());
806
+ assert.deepEqual(yield* resolveOn("darwin"), Option.none());
807
808
const zedEditor = path.join(home, ".local/bin/zed");
809
yield* fs.makeDirectory(path.dirname(zedEditor), { recursive: true });
810
yield* fs.writeFileString(zedEditor, "#!/bin/sh\necho 'Zed 0.200.0'\n");
811
yield* fs.chmod(zedEditor, 0o755);
809
- assert.deepEqual(yield* resolve, Option.some({ command: zedEditor, baseArgs: [] }));
812
+ assert.deepEqual(yield* resolveOn("linux"), Option.some({ command: zedEditor, baseArgs: [] }));
813
+
814
+ yield* fs.remove(zedEditor);
815
+ const laterZed = path.join(laterBin, "zed");
816
+ yield* fs.makeDirectory(laterBin, { recursive: true });
817
+ yield* fs.writeFileString(laterZed, "#!/bin/sh\necho 'Zed 0.200.0'\n");
818
+ yield* fs.chmod(laterZed, 0o755);
819
+ for (const platform of ["linux", "darwin"] as const) {
820
+ assert.deepEqual(
821
+ yield* resolveOn(platform),
822
+ Option.some({ command: laterZed, baseArgs: [] }),
823
+ );
824
+ }
825
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
826
);
827
packages/shared/src/editor.ts
+17
-10
@@ -213,19 +213,26 @@ export const resolveEditorCommand = Effect.fn("editor.resolveEditorCommand")(fun
213
.map((entry) => path.join(dir, entry)),
214
);
215
}
216
+ const probeZed = editor.id === "zed" && platform !== "win32";
217
const rejected = new Set<string>();
218
for (const candidate of candidates) {
218
- const resolved = yield* resolveCommandPath(candidate, { env });
219
- if (resolved === null || rejected.has(resolved)) continue;
220
- if (preferZeditor && path.basename(candidate) === "zed" && !(yield* isZedEditor(resolved))) {
221
- rejected.add(resolved);
222
- continue;
219
+ // OpenZFS zed can shadow the editor's zed in an earlier PATH entry.
220
+ const matches =
221
+ probeZed && candidate === "zed"
222
+ ? yield* resolveCommandPaths(candidate, { env, until: () => false })
223
+ : [yield* resolveCommandPath(candidate, { env })];
224
+ for (const resolved of matches) {
225
+ if (resolved === null || rejected.has(resolved)) continue;
226
+ if (probeZed && path.basename(candidate) === "zed" && !(yield* isZedEditor(resolved))) {
227
+ rejected.add(resolved);
228
+ continue;
229
+ }
230
+ return Option.some({
231
+ command: resolved === matches[0] ? candidate : resolved,
232
+ baseArgs:
233
+ editor.id === "kiro" && (platform === "darwin" || platform === "win32") ? [] : baseArgs,
234
+ });
235
}
224
- return Option.some({
225
- command: candidate,
226
- baseArgs:
227
- editor.id === "kiro" && (platform === "darwin" || platform === "win32") ? [] : baseArgs,
228
- });
236
}
237
return Option.none();
238
});