@devries-cameron20 / t3code-1 / commits / 5623089aea
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): disable color probes in worktree setup (#11843)

Julius Marminge committed Sep 14, 2026 at 20:30 UTC 5623089aea68ca62811f51321686c259fa4c810f
3 files changed +15 -3
apps/server/src/project/ProjectSetupScriptRunner.test.ts
+8 -1
@@ -112,7 +112,12 @@ describe("ProjectSetupScriptRunner", () => {
112 terminalId: "setup-default-setup",
113 cwd: "/repo/worktrees/a",
114 worktreePath: "/repo/worktrees/a",
115 - env: { T3CODE_PROJECT_ROOT: "/repo/project", T3CODE_WORKTREE_PATH: "/repo/worktrees/a" },
115 + env: {
116 + T3CODE_PROJECT_ROOT: "/repo/project",
117 + T3CODE_WORKTREE_PATH: "/repo/worktrees/a",
118 + NO_COLOR: "1",
119 + FORCE_COLOR: "0",
120 + },
121 });
122 expect(write).toHaveBeenCalledWith({
123 threadId: "thread-1",
@@ -211,6 +216,8 @@ describe("ProjectSetupScriptRunner", () => {
216 cwd: "/repo/worktrees/a",
217 worktreePath: "/repo/worktrees/a",
218 env: {
219 + NO_COLOR: "1",
220 + FORCE_COLOR: "0",
221 T3CODE_PROJECT_ROOT: "/repo/project",
222 T3CODE_WORKTREE_PATH: "/repo/worktrees/a",
223 },
apps/server/src/project/ProjectSetupScriptRunner.ts
+2 -1
@@ -361,7 +361,8 @@ export const make = Effect.gen(function* () {
361 terminalId,
362 cwd,
363 worktreePath: input.worktreePath,
364 - env,
364 + // Setup may run before a terminal client attaches to answer color probes.
365 + env: { ...env, NO_COLOR: "1", FORCE_COLOR: "0" },
366 })
367 .pipe(
368 Effect.mapError(
apps/server/src/terminal/Manager.test.ts
+5 -1
@@ -1934,13 +1934,15 @@ it.layer(
1934
1935 it.effect("injects runtime env overrides into spawned terminals", () =>
1936 Effect.gen(function* () {
1937 - const { manager, ptyAdapter } = yield* createManager();
1937 + const { manager, ptyAdapter } = yield* createManager(5, { env: { FORCE_COLOR: "3" } });
1938 yield* manager.open(
1939 openInput({
1940 env: {
1941 T3CODE_PROJECT_ROOT: "/repo",
1942 T3CODE_WORKTREE_PATH: "/repo/worktree-a",
1943 CUSTOM_FLAG: "1",
1944 + NO_COLOR: "1",
1945 + FORCE_COLOR: "0",
1946 },
1947 }),
1948 );
@@ -1951,6 +1953,8 @@ it.layer(
1953 assert.equal(spawnInput.env.T3CODE_PROJECT_ROOT, "/repo");
1954 assert.equal(spawnInput.env.T3CODE_WORKTREE_PATH, "/repo/worktree-a");
1955 assert.equal(spawnInput.env.CUSTOM_FLAG, "1");
1956 + assert.equal(spawnInput.env.NO_COLOR, "1");
1957 + assert.equal(spawnInput.env.FORCE_COLOR, "0");
1958 }),
1959 );
1960