fix(server): disable color probes in worktree setup (#11843)
This commit is contained in:
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(
|
||||
|
||||
@@ -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");
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user