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

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-14 20:30:29 -07:00
1 parent a62e7d670c
commit 5623089aea
3 files changed
+15 -3

No files matched your search

@@ -112,7 +112,12 @@ describe("ProjectSetupScriptRunner", () => {
terminalId: "setup-default-setup",
cwd: "/repo/worktrees/a",
worktreePath: "/repo/worktrees/a",
env: { T3CODE_PROJECT_ROOT: "/repo/project", T3CODE_WORKTREE_PATH: "/repo/worktrees/a" },
env: {
T3CODE_PROJECT_ROOT: "/repo/project",
T3CODE_WORKTREE_PATH: "/repo/worktrees/a",
NO_COLOR: "1",
FORCE_COLOR: "0",
},
});
expect(write).toHaveBeenCalledWith({
threadId: "thread-1",
@@ -211,6 +216,8 @@ describe("ProjectSetupScriptRunner", () => {
cwd: "/repo/worktrees/a",
worktreePath: "/repo/worktrees/a",
env: {
NO_COLOR: "1",
FORCE_COLOR: "0",
T3CODE_PROJECT_ROOT: "/repo/project",
T3CODE_WORKTREE_PATH: "/repo/worktrees/a",
},
@@ -361,7 +361,8 @@ export const make = Effect.gen(function* () {
terminalId,
cwd,
worktreePath: input.worktreePath,
env,
// Setup may run before a terminal client attaches to answer color probes.
env: { ...env, NO_COLOR: "1", FORCE_COLOR: "0" },
})
.pipe(
Effect.mapError(
+5 -1
View File
@@ -1934,13 +1934,15 @@ it.layer(
it.effect("injects runtime env overrides into spawned terminals", () =>
Effect.gen(function* () {
const { manager, ptyAdapter } = yield* createManager();
const { manager, ptyAdapter } = yield* createManager(5, { env: { FORCE_COLOR: "3" } });
yield* manager.open(
openInput({
env: {
T3CODE_PROJECT_ROOT: "/repo",
T3CODE_WORKTREE_PATH: "/repo/worktree-a",
CUSTOM_FLAG: "1",
NO_COLOR: "1",
FORCE_COLOR: "0",
},
}),
);
@@ -1951,6 +1953,8 @@ it.layer(
assert.equal(spawnInput.env.T3CODE_PROJECT_ROOT, "/repo");
assert.equal(spawnInput.env.T3CODE_WORKTREE_PATH, "/repo/worktree-a");
assert.equal(spawnInput.env.CUSTOM_FLAG, "1");
assert.equal(spawnInput.env.NO_COLOR, "1");
assert.equal(spawnInput.env.FORCE_COLOR, "0");
}),
);