authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-14 20:30:29-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-14 20:30:29-07:00
log5623089aea68ca62811f51321686c259fa4c810f
treecf7dfeb66aab2cf0b19c4ea935d3bbb7254bf56a
parenta62e7d670c67bf221a5699b5a988367781fead74
signature Signed by PGP key B5690EEEBB952194

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


3 files changed, 15 insertions(+), 3 deletions(-)

apps/server/src/project/ProjectSetupScriptRunner.test.ts+8-1
......@@ -112,7 +112,12 @@ describe("ProjectSetupScriptRunner", () => {
112112 terminalId: "setup-default-setup",
113113 cwd: "/repo/worktrees/a",
114114 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 },
116121 });
117122 expect(write).toHaveBeenCalledWith({
118123 threadId: "thread-1",
......@@ -211,6 +216,8 @@ describe("ProjectSetupScriptRunner", () => {
211216 cwd: "/repo/worktrees/a",
212217 worktreePath: "/repo/worktrees/a",
213218 env: {
219 NO_COLOR: "1",
220 FORCE_COLOR: "0",
214221 T3CODE_PROJECT_ROOT: "/repo/project",
215222 T3CODE_WORKTREE_PATH: "/repo/worktrees/a",
216223 },
apps/server/src/project/ProjectSetupScriptRunner.ts+2-1
......@@ -361,7 +361,8 @@ export const make = Effect.gen(function* () {
361361 terminalId,
362362 cwd,
363363 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" },
365366 })
366367 .pipe(
367368 Effect.mapError(
apps/server/src/terminal/Manager.test.ts+5-1
......@@ -1934,13 +1934,15 @@ it.layer(
19341934
19351935 it.effect("injects runtime env overrides into spawned terminals", () =>
19361936 Effect.gen(function* () {
1937 const { manager, ptyAdapter } = yield* createManager();
1937 const { manager, ptyAdapter } = yield* createManager(5, { env: { FORCE_COLOR: "3" } });
19381938 yield* manager.open(
19391939 openInput({
19401940 env: {
19411941 T3CODE_PROJECT_ROOT: "/repo",
19421942 T3CODE_WORKTREE_PATH: "/repo/worktree-a",
19431943 CUSTOM_FLAG: "1",
1944 NO_COLOR: "1",
1945 FORCE_COLOR: "0",
19441946 },
19451947 }),
19461948 );
......@@ -1951,6 +1953,8 @@ it.layer(
19511953 assert.equal(spawnInput.env.T3CODE_PROJECT_ROOT, "/repo");
19521954 assert.equal(spawnInput.env.T3CODE_WORKTREE_PATH, "/repo/worktree-a");
19531955 assert.equal(spawnInput.env.CUSTOM_FLAG, "1");
1956 assert.equal(spawnInput.env.NO_COLOR, "1");
1957 assert.equal(spawnInput.env.FORCE_COLOR, "0");
19541958 }),
19551959 );
19561960