# fix\(terminal\): identify T3 Code to integrated shells · PR \#22827 · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/pull/22827)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

State: open (draft)

Source repository: pingdotgg/t3code

Source branch: fix/issue-8450

Target branch: main

Head commit: acaee8879d3a9bc55bce3d7ce205bff688688bcb

[Discussion and reviews](https://git.cafe/pingdotgg/t3code/pull/22827)

[Commits](https://git.cafe/pingdotgg/t3code/pull/22827/commits?format=markdown)

[Files changed](https://git.cafe/pingdotgg/t3code/pull/22827/diffs?format=markdown)

## Description

---

## Problem

The integrated terminal did not identify T3 Code to shells, so shell prompts and terminal detection inherited the parent terminal identity or fell back to generic behavior.

## Change

Set `TERM_PROGRAM=t3code` and `TERM_PROGRAM_VERSION` from the server app version in the shared shell spawn path. Open and restart use the same path. Existing COLORTERM behavior, user environment passthrough, and filtering are unchanged.

## Scope and approval

Fixes #8450

Triaged bug via the automated issue flow.

- Manager.test.ts: 42 → 43 tests, 43 passing after implementation. The new open/restart regression fails on the tests-only commit because the parent terminal identity remains.
- Scoped lint passes (one existing warning); server typecheck passes with existing suggestions.
- No regex, parser, dependency, schema, client, or render changes.

## Verification

References [#8450](https://git.cafe/pingdotgg/t3code/issues/8450).

### Validation

### Evidence

[Fixture matrix](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/40550cdc58b6ebe0/matrix.md).

| Linux browser integrated terminal | Before | After |
| --- | --- | --- |
| Real app, bash, node-pty; command `env | grep -E 'TERM|COLORTERM'` | [Transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/65a5260038d75e4f/before.txt), [1688f96568](https://git.cafe/pingdotgg/t3code/commit/1688f965682d331da16a8c39f049592361f69c8d) | [Transcript](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/32221647a6ddb9c9/after.txt), [8c937f85fb](https://git.cafe/pingdotgg/t3code/commit/8c937f85fb66060fe4e835078cadb03ba33b9939) |

Before output: `COLORTERM=truecolor`, `TERM=xterm-256color`; TERM_PROGRAM and TERM_PROGRAM_VERSION absent. After adds `TERM_PROGRAM=t3code`, `TERM_PROGRAM_VERSION=0.1.1`, matching the server package version. The app ran with T3CODE_HOME unset and explicit isolated home `/home/ubuntu/wt/issue-8450/.t3`, web port 7015, server port 15055. The transcript includes the checked-out after SHA. A new shell was opened after the dev server reloaded the implementation.

What else changed: no render paths changed. Runtime output adds the two terminal identity variables; TERM and COLORTERM remain as before. No screenshot/pixel diff is applicable to this server environment change.

Unverified surfaces: native Windows ConPTY and Electron desktop/macOS, including packaged desktop version. Base inherited identity, open/restart and unrelated passthrough/filtering are covered by the service test; session runtime identity override precedence was inspected in code, not independently exercised. The fixed T3 identity also replaces an explicitly supplied TERM_PROGRAM/TERM_PROGRAM_VERSION. Mixed-case Windows inherited identity keys were not exercised.

Model: GPT-6.1-Sol. Harness: Codex through T3 Code. Independent reviewers: Codex GPT-6.1-Sol and Claude Opus 5.5, both VERDICT: MERGE with no confirmed findings. Proof audit pass 1 accepted the evidence plan; [pass 2](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/4f2a6fa60c0c86c3/proof-audit-pass2.md) returned SUFFICIENT. New and restarted shells receive the identity; already-running shells retain their old environment.

