Skip to content

Interactive mode: make it behave like a real terminal#257

Merged
ANonABento merged 1 commit into
mainfrom
interactive-terminal-fidelity
Jun 7, 2026
Merged

Interactive mode: make it behave like a real terminal#257
ANonABento merged 1 commit into
mainfrom
interactive-terminal-fidelity

Conversation

@ANonABento

Copy link
Copy Markdown
Owner

Interactive mode already renders the real claude/codex TUI via raw-PTY xterm passthrough (arrows/Ctrl/Tab/Esc/resize already work). This closes the gaps that made it feel un-terminal-like. All green: clippy + cargo test --workspace (497+19), vitest (411), tsc, lint.

A — Single input surface

Dropped the line-injecting chat box from the interactive panel. The terminal is now the sole input, so Tab-complete, slash menus, @file mentions, y/n prompts, and multi-line paste work natively — the chat box submitted whole lines + a forced Enter, which broke all of those. A thin hint points the user at the terminal.

B — Terminal fidelity

  • tmux set -g mouse on + history-limit 50000 at server start → scroll/click inside TUIs and deep scrollback (was ~2000 lines).
  • Debounced the terminal-view resize cascade so a drag-resize issues one fit instead of a burst of resize_pty calls that flicker the TUI.

C — Completion is advisory, not authoritative

An interactive session is human-in-the-loop, so the watcher no longer:

  • auto-advances the pipeline the instant the agent prints its done-sentinel, or
  • marks a session FAILED at the 2h timeout.

Instead it keeps the TUI alive, drops the task to idle, and emits agent:<task>:interactive_done. The panel shows an "Advance column" affordance; you advance when satisfied via the new agent_advance command (same mark_complete the headless path runs). The /exit-on-success teardown is removed so the session persists for continued chat.

Notes / follow-ups

  • The advisory signal is currently event-based (surfaces while the panel is attached). A persisted flag (so a closed-panel task shows a "ready to advance" badge on the card) is a sensible follow-up.
  • Not in this PR (from the same audit): adaptive readiness (no hard-kill on slow cold start) and codex --append-system-prompt/resume parity.

🤖 Generated with Claude Code

Interactive mode already renders the real claude/codex TUI via raw-PTY xterm
passthrough; this closes the gaps that made it feel un-terminal-like.

A. Single input surface. Drop the line-injecting chat box from the interactive
   panel — the terminal is now the sole input, so Tab-complete, slash menus,
   @-file mentions, y/n prompts and multi-line paste all work natively (the
   chat box submitted whole lines + a forced Enter, which broke all of those).
   A thin hint points the user at the terminal.

B. Terminal fidelity. Enable tmux mouse mode + history-limit 50000 globally at
   server start (scroll/click inside TUIs; deep scrollback instead of ~2000
   lines). Debounce the terminal-view resize cascade so a drag-resize issues one
   fit instead of a burst of resize_pty calls that flicker the TUI.

C. Completion is advisory, not authoritative. An interactive session is
   human-in-the-loop, so the watcher no longer auto-advances the pipeline the
   instant the agent prints its done-sentinel, and no longer marks a session
   FAILED at the 2h timeout. Instead it keeps the TUI alive, drops the task to
   idle, and emits agent:<task>:interactive_done. The panel surfaces an "Advance
   column" affordance; the user advances when satisfied via the new agent_advance
   command (runs the same mark_complete the headless path runs). The /exit-on-
   success teardown is removed so the session persists for continued chat.

Tests: cargo clippy/test --workspace (497+19), vitest (411, +banner test), tsc,
lint — all green.
@ANonABento ANonABento merged commit 19115d3 into main Jun 7, 2026
3 checks passed
@ANonABento ANonABento deleted the interactive-terminal-fidelity branch June 7, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant