Unified · Split
| @@ -108,7 +108,11 @@ describe("ProjectSetupScriptRunner", () => { · 107 unmodified lines | ||
| 108 | 108 | terminalId: "setup-default-setup", |
| 109 | 109 | cwd: "/repo/worktrees/a", |
| 110 | 110 | worktreePath: "/repo/worktrees/a", |
| 111 | − env: { T3CODE_PROJECT_ROOT: "/repo/project", T3CODE_WORKTREE_PATH: "/repo/worktrees/a" }, | |
| 111 | + env: { | |
| 112 | + T3CODE_PROJECT_ROOT: "/repo/project", | |
| 113 | + T3CODE_WORKTREE_PATH: "/repo/worktrees/a", | |
| 114 | + COLORTERM: "", | |
| 115 | + }, | |
| 112 | 116 | }); |
| 113 | 117 | expect(write).toHaveBeenCalledWith({ |
| 114 | 118 | threadId: "thread-1", |
| @@ -207,6 +211,7 @@ describe("ProjectSetupScriptRunner", () => { · 92 unmodified lines | ||
| 207 | 211 | env: { |
| 208 | 212 | T3CODE_PROJECT_ROOT: "/repo/project", |
| 209 | 213 | T3CODE_WORKTREE_PATH: "/repo/worktrees/a", |
| 214 | + COLORTERM: "", | |
| 210 | 215 | }, |
| 211 | 216 | }); |
| 212 | 217 | expect(write).toHaveBeenCalledWith({ |
| @@ -149,10 +149,16 @@ export const make = Effect.gen(function* () { · 148 unmodified lines | ||
| 149 | 149 | |
| 150 | 150 | const terminalId = input.preferredTerminalId ?? `setup-${script.id}`; |
| 151 | 151 | const cwd = input.worktreePath; |
| 152 | − const env = projectScriptRuntimeEnv({ | |
| 153 | − project: { cwd: project.workspaceRoot }, | |
| 154 | − worktreePath: input.worktreePath, | |
| 155 | − }); | |
| 152 | + const env = { | |
| 153 | + ...projectScriptRuntimeEnv({ | |
| 154 | + project: { cwd: project.workspaceRoot }, | |
| 155 | + worktreePath: input.worktreePath, | |
| 156 | + }), | |
| 157 | + // Setup runs before a client necessarily attaches. Truecolor probing in | |
| 158 | + // tools such as vp can wait for terminal replies that nobody can send. | |
| 159 | + // Keep TERM's 256-color support without advertising truecolor here. | |
| 160 | + COLORTERM: "", | |
| 161 | + }; | |
| 156 | 162 | |
| 157 | 163 | yield* terminalManager |
| 158 | 164 | .open({ |
| @@ -1711,7 +1711,8 @@ it.layer( · 1710 unmodified lines | ||
| 1711 | 1711 | [undefined, undefined, "truecolor"], |
| 1712 | 1712 | ["", undefined, "truecolor"], |
| 1713 | 1713 | ["24bit", undefined, "24bit"], |
| 1714 | − ["24bit", "", "truecolor"], | |
| 1714 | + ["24bit", "", ""], | |
| 1715 | + [undefined, "", ""], | |
| 1715 | 1716 | ["24bit", "custom", "custom"], |
| 1716 | 1717 | ] as const) { |
| 1717 | 1718 | const env = Object.freeze({ COLORTERM: parentColor }); |
| @@ -1286,8 +1286,9 @@ function createTerminalSpawnEnv( · 1285 unmodified lines | ||
| 1286 | 1286 | key === "CODEX_HOME" || key === "CLAUDE_CONFIG_DIR" ? expandHomePath(value) : value; |
| 1287 | 1287 | } |
| 1288 | 1288 | } |
| 1289 | − // Both PTY backends feed truecolor-capable terminal clients. | |
| 1290 | − if (spawnEnv.COLORTERM === undefined || spawnEnv.COLORTERM === "") { | |
| 1289 | + // An explicit empty override opts out for terminals started without a client. | |
| 1290 | + // Otherwise both PTY backends feed truecolor-capable terminal clients. | |
| 1291 | + if (!spawnEnv.COLORTERM && runtimeEnv?.COLORTERM === undefined) { | |
| 1291 | 1292 | spawnEnv.COLORTERM = "truecolor"; |
| 1292 | 1293 | } |
| 1293 | 1294 | return stripAppImageRuntimeEnv(spawnEnv); |