@adhdev/session-host-core 1.0.58-rc.9 → 1.0.58-rc.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/spawn-env.ts CHANGED
@@ -57,6 +57,29 @@ export function sanitizeSpawnEnv(
57
57
  delete env.NO_COLOR;
58
58
  delete env.COLOR;
59
59
 
60
+ // Never forward an inherited terminal geometry. COLUMNS/LINES are advisory
61
+ // overrides that a TUI trusts *in preference to* the real TTY size
62
+ // (measured: with COLUMNS=17 exported, a child on a genuine 80-column PTY
63
+ // reports `tput cols` = 17). The PTY here is sized independently from the
64
+ // adapter's own geometry, so any inherited value is by definition unrelated
65
+ // to the terminal the child was actually given.
66
+ //
67
+ // When the two disagree the child lays out for the phantom width and the
68
+ // VT renders at the real one, so in-place repaints (`\r`, absolute cursor
69
+ // moves) land on the wrong row: content fragments across the buffer with a
70
+ // blank gap between the stale head and the live tail. Observed on
71
+ // antigravity-cli as a "Running command" spinner split into two rows 28
72
+ // blank lines apart, which the spec's from_top/from_bottom sections then
73
+ // sliced into separate body/footer values.
74
+ //
75
+ // Deleting them makes the child measure the TTY via ioctl(TIOCGWINSZ) —
76
+ // the PTY's real size, which is exactly what the VT is sized to. node-pty
77
+ // does not set these itself, so a clean parent env is already the normal
78
+ // case; this only removes a value that leaked in from whatever launched
79
+ // the daemon (interactive shell, tmux, CI runner, nested CLI).
80
+ delete env.COLUMNS;
81
+ delete env.LINES;
82
+
60
83
  // Do not leak a parent Claude Code session identity into spawned claude-cli
61
84
  // children. CLAUDE_CODE_CHILD_SESSION makes a spawned claude run as a nested
62
85
  // child that does NOT persist its ~/.claude/projects transcript, so the