You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
P1: Isolate terminal replies, drafts and command history when switching threads #1182
Audit #1180, 2026-09-10. Baseline: checkout 9fc8645; fetched origin/main bf6fb02 has identical relevant implementation. This is implementation backlog, not a shipped fix.
Reproduced
Mounted the actual TerminalPane with the existing DOM harness:
Open A, submit echo A, and defer the write promise.
Switch the same pane to B; its open reply displays B.
Resolve A's write with non-reset text "late A" and its new cursor.
B now contains A's output. ArrowUp in B also recalls echo A.
Both outcomes were asserted against the rendered component. This is a deterministic simulated-transport check, not a desktop screenshot test.
Cause
src/components/TerminalPane.tsx: submit/restart promise chains call applyState without checking the current thread/session generation. Open/poll have cleanup guards; mutations do not. The thread-change effect also retains draft and history refs. Late replies can overwrite B's cursor, cwd and running state. Rejected writes clear the draft and silently swallow errors.
Acceptance
Old thread/restart replies never alter the active pane, including A to B to A.
Scope history and preserve unsent command drafts by thread.
Recover the draft on rejected write and show actionable errors for write/restart failures.
Cover delayed write/restart, thread switches and failed submission.
Distinct from #934: that ticket concerns overlapping deltas within one session. This concerns session ownership and unsent command state. Check its landed branch before editing shared cursor handling.
Obsolete: the piped line-input terminal with its own history was replaced by the xterm PTY, and pushes are filtered by threadId + termId (TerminalPane.tsx:162). Closing in the 2026-10-09 board cleanup (#1532).
Activity
currentbits commentedon Oct 9, 2026
Obsolete: the piped line-input terminal with its own history was replaced by the xterm PTY, and pushes are filtered by threadId + termId (
TerminalPane.tsx:162). Closing in the 2026-10-09 board cleanup (#1532).