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 24, 10:15 UTC
fix(server): advertise truecolor in the integrated terminal (#7680)
Co-authored-by: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com>
Shubh committed
Sep 5, 2026 at 07:04 UTC
89ee69e4430b21ee14565abf5c34dae43f38c1d8
2 files changed
+29
apps/server/src/terminal/Manager.test.ts
+25
@@ -1687,6 +1687,31 @@ it.layer(
1687
}),
1688
);
1689
1690
+ it.effect.each(["linux", "darwin", "win32"] as const)(
1691
+ "advertises truecolor before the PTY backend on %s without replacing explicit values",
1692
+ (platform) =>
1693
+ Effect.gen(function* () {
1694
+ for (const [parentColor, runtimeColor, expected] of [
1695
+ [undefined, undefined, "truecolor"],
1696
+ ["", undefined, "truecolor"],
1697
+ ["24bit", undefined, "24bit"],
1698
+ ["24bit", "", "truecolor"],
1699
+ ["24bit", "custom", "custom"],
1700
+ ] as const) {
1701
+ const env = Object.freeze({ COLORTERM: parentColor });
1702
+ const { manager, ptyAdapter } = yield* createManager(5, {
1703
+ shellResolver: () => "/bin/sh",
1704
+ env,
1705
+ }).pipe(Effect.provide(withHostPlatform(platform)));
1706
+ yield* manager.open(
1707
+ openInput({ env: runtimeColor === undefined ? {} : { COLORTERM: runtimeColor } }),
1708
+ );
1709
+ expect(ptyAdapter.spawnInputs[0]?.env.COLORTERM).toBe(expected);
1710
+ expect(env.COLORTERM).toBe(parentColor);
1711
+ }
1712
+ }),
1713
+ );
1714
+
1715
it.effect("filters app runtime env variables from terminal sessions", () =>
1716
Effect.gen(function* () {
1717
const { manager, ptyAdapter } = yield* createManager(5, {
apps/server/src/terminal/Manager.ts
+4
@@ -1270,6 +1270,10 @@ function createTerminalSpawnEnv(
1270
spawnEnv[key] = value;
1271
}
1272
}
1273
+ // Both PTY backends feed truecolor-capable terminal clients.
1274
+ if (spawnEnv.COLORTERM === undefined || spawnEnv.COLORTERM === "") {
1275
+ spawnEnv.COLORTERM = "truecolor";
1276
+ }
1277
return stripAppImageRuntimeEnv(spawnEnv);
1278
}
1279