grid: answer XTGETTCAP TN with the TERM the session was spawned with #440

Merged
natsukium merged 2 commits from grid/xtgettcap-tn-native into main 2026-09-25 12:30:31 +09:00
Owner

XTGETTCAP TN / name answered a hardcoded xterm-256color while every other identity surface is native. Per the decision on the issue, it now reports the stamped TERM: xterm-felis, or the FELIS_TERM hatch value.

  • Grid holds the host-stamped TERM (set_term_name), kept across RIS; TN / name answer it, and report the cap unknown when no host set one.
  • The daemon's SpawnedPty::spawn reads TERM off the fully resolved spawn command (after the identity stamp and the caller's explicit pairs), so TN and the child's $TERM agree. felis-protocol is untouched.
  • esctest queries only Co, so its expectations and baseline are unaffected.
  • Docs: vt-compliance XTGETTCAP bullet, terminal-identity reference, REQ-900, the security-model identity-reply paragraph and the testing summary name TN as fixed at spawn. CHANGELOG "Changed" entry.

Closes #388

XTGETTCAP `TN` / `name` answered a hardcoded `xterm-256color` while every other identity surface is native. Per the decision on the issue, it now reports the stamped TERM: `xterm-felis`, or the `FELIS_TERM` hatch value. - `Grid` holds the host-stamped TERM (`set_term_name`), kept across RIS; `TN` / `name` answer it, and report the cap unknown when no host set one. - The daemon's `SpawnedPty::spawn` reads `TERM` off the fully resolved spawn command (after the identity stamp and the caller's explicit pairs), so `TN` and the child's `$TERM` agree. felis-protocol is untouched. - esctest queries only `Co`, so its expectations and baseline are unaffected. - Docs: vt-compliance XTGETTCAP bullet, terminal-identity reference, REQ-900, the security-model identity-reply paragraph and the testing summary name `TN` as fixed at spawn. CHANGELOG "Changed" entry. Closes #388
felis identifies natively on every other identity surface (TERM,
TERM_PROGRAM, XTVERSION, DA3), but XTGETTCAP TN still answered
xterm-256color, so a program that asked the terminal for its name got a
different answer from one that read $TERM, and the FELIS_TERM hatch did
not reach it either. kitty's TN likewise answers its own TERM.

The daemon hands the grid the TERM from the fully resolved spawn
command, after the identity stamp and the caller's explicit pairs, so
TN and the child's $TERM cannot disagree; felis-protocol is untouched.
The name is host state rather than parsed VT state, so it survives
RIS, and a grid no host has told reports the cap unknown rather than
inventing a name. esctest never queries TN, so its baseline is
unaffected. REQ-900 and the security model name TN as the one identity
reply fed from outside the build: it is fixed at spawn, so no output
can steer it.

Assisted-by: Claude Code
docs: name XTGETTCAP TN as spawn-fixed in the injection test summary
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 13s
darwin / darwin docs-only no-op (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 54s
darwin / publish felis (aarch64-darwin) (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Has been cancelled
windows / cargo nextest (Windows) (pull_request) Has been cancelled
windows / frontend smoke (Windows) (pull_request) Has been cancelled
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been cancelled
fuzz / cargo fuzz smoke (per target) (pull_request) Has been cancelled
pr / nix flake check (pull_request) Has been cancelled
pr / cargo build / clippy / test / deny (pull_request) Has been cancelled
pr / wire schema is compatible with the base (pull_request) Has been cancelled
pr / frontend smoke (x86_64-linux) (pull_request) Has been cancelled
pr / publish felis (x86_64-linux) (pull_request) Has been cancelled
bench / Criterion regression gate (pull_request) Has been cancelled
windows / detect relevant changes (pull_request) Successful in 25s
windows / windows docs-only no-op (pull_request) Has been skipped
466443e663
The testing reference still called every XTGETTCAP answer a static identity. TN now comes from the session's spawn-time TERM, which is still independent of prior output, and the summary should say which of the two it is.

Assisted-by: Claude Code
natsukium deleted branch grid/xtgettcap-tn-native 2026-09-25 12:30:31 +09:00
Commenting is not possible because the repository is archived.
No description provided.