The best way to control Claude Code, Codex and more from any computer or phone
fix(terminal): fish no longer stalls 10s on startup (#19685)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Theo Browne committed
Oct 18, 2026 at 22:51 UTC
45ad47df2254c226eb05e7f54c396aa28022cb43
3 files changed
+96
apps/server/src/terminal/Manager.test.ts
+73
@@ -2248,6 +2248,79 @@ it.layer(
2248
}),
2249
);
2250
2251
+ it.effect("turns off fish terminal queries unless the user chose query-term", () =>
2252
+ Effect.gen(function* () {
2253
+ for (const [platform, env, runtimeEnv, expected] of [
2254
+ ["linux", {}, {}, { fish_features: "no-query-term" }],
2255
+ [
2256
+ "linux",
2257
+ { fish_features: "qmark-noglob" },
2258
+ {},
2259
+ { fish_features: "qmark-noglob,no-query-term" },
2260
+ ],
2261
+ [
2262
+ "linux",
2263
+ { fish_features: "qmark-noglob,query-term" },
2264
+ {},
2265
+ { fish_features: "qmark-noglob,query-term" },
2266
+ ],
2267
+ [
2268
+ "linux",
2269
+ { fish_features: "qmark-noglob,no-query-term" },
2270
+ {},
2271
+ { fish_features: "qmark-noglob,no-query-term" },
2272
+ ],
2273
+ [
2274
+ "linux",
2275
+ { fish_features: "query-term" },
2276
+ { fish_features: "qmark-noglob" },
2277
+ { fish_features: "qmark-noglob,no-query-term" },
2278
+ ],
2279
+ [
2280
+ "win32",
2281
+ { FISH_FEATURES: "qmark-noglob" },
2282
+ {},
2283
+ { FISH_FEATURES: "qmark-noglob,no-query-term" },
2284
+ ],
2285
+ [
2286
+ "win32",
2287
+ { Fish_Features: "qmark-noglob,query-term" },
2288
+ {},
2289
+ { Fish_Features: "qmark-noglob,query-term" },
2290
+ ],
2291
+ [
2292
+ "win32",
2293
+ { FISH_FEATURES: "qmark-noglob,no-query-term" },
2294
+ {},
2295
+ { FISH_FEATURES: "qmark-noglob,no-query-term" },
2296
+ ],
2297
+ [
2298
+ "win32",
2299
+ { Fish_Features: "query-term" },
2300
+ { fish_features: "qmark-noglob" },
2301
+ { Fish_Features: "qmark-noglob,no-query-term" },
2302
+ ],
2303
+ [
2304
+ "win32",
2305
+ { FISH_FEATURES: "no-query-term" },
2306
+ { fish_features: "qmark-noglob,query-term" },
2307
+ { FISH_FEATURES: "qmark-noglob,query-term" },
2308
+ ],
2309
+ ] as const) {
2310
+ const { manager, ptyAdapter } = yield* createManager(5, {
2311
+ env,
2312
+ }).pipe(Effect.provide(layerWithHostPlatform(platform)));
2313
+ yield* manager.open(openInput({ env: runtimeEnv }));
2314
+ const fishFeatures = Object.fromEntries(
2315
+ Object.entries(ptyAdapter.spawnInputs[0]!.env).filter(
2316
+ ([key]) => key.toLowerCase() === "fish_features",
2317
+ ),
2318
+ );
2319
+ expect.soft(fishFeatures, JSON.stringify({ platform, env, runtimeEnv })).toEqual(expected);
2320
+ }
2321
+ }),
2322
+ );
2323
+
2324
it.effect("filters app runtime env variables from terminal sessions", () =>
2325
Effect.gen(function* () {
2326
const { manager, ptyAdapter } = yield* createManager(5, {
apps/server/src/terminal/Manager.ts
+11
@@ -1296,6 +1296,17 @@ function createTerminalSpawnEnv(
1296
if (!spawnEnv.COLORTERM && runtimeEnv?.COLORTERM === undefined) {
1297
spawnEnv.COLORTERM = "truecolor";
1298
}
1299
+ // fish 4.1+ can wait 10s at startup for a DA1 reply before a renderer can answer.
1300
+ // Skip the query unless the user or provider already chose `query-term` or `no-query-term`.
1301
+ const fishFeaturesKey =
1302
+ platform === "win32"
1303
+ ? (Object.keys(spawnEnv).find((candidate) => candidate.toLowerCase() === "fish_features") ??
1304
+ "fish_features")
1305
+ : "fish_features";
1306
+ const fishFeatures = spawnEnv[fishFeaturesKey];
1307
+ if (!fishFeatures?.includes("query-term")) {
1308
+ spawnEnv[fishFeaturesKey] = fishFeatures ? `${fishFeatures},no-query-term` : "no-query-term";
1309
+ }
1310
return stripAppImageRuntimeEnv(spawnEnv);
1311
}
1312
docs/user/terminal.md
+12
@@ -16,3 +16,15 @@ To copy all retained output, choose Select all in the terminal's context menu,
16
then copy. Cmd+A on macOS and Ctrl+Shift+A elsewhere select the same output.
17
Ctrl+A still moves to the beginning of shell input on Windows and Linux.
18
Jump to latest in the context menu returns to the current output.
19
+
20
+## fish
21
+
22
+T3 Code starts fish with `no-query-term`, avoiding startup waits for terminal
23
+replies. This disables optional fish features that depend on those replies.
24
+T3 Code's exported `fish_features` also hides any universal flags you set with
25
+`set -U fish_features`.
26
+
27
+To preserve those flags or enable queries with `query-term`, include them in
28
+`fish_features` in the environment that launches T3 Code. A shell export applies
29
+when you launch T3 Code from that shell; it does not configure a desktop app
30
+launched from the Dock or Finder. Enabling queries can restore the startup wait.