Skip to content

feat(terminal): Mouse Mode Submit button for agent terminal panes #819

Description

@Juliusolsson05

Motivation

Mouse Mode (mouseModeEnabled) gates Send/Stop in ComposerActions, but only inside the rendered feed (TileLeaf). When an agent runs in Terminal view (AgentTerminalLeaf — Claude/Codex TUI, and the OpenCode Terminal runtime), there is no composer and no mouse-reachable way to press Enter. A mouse-only user who dictated or pasted a command into the raw PTY cannot submit it. Dictation deliberately does not auto-submit ("user reviews, then presses Enter" — useComposerDictation), so a mouse-only user has no path to that final Enter without the keyboard.

Follows the Mouse Mode gap from docs/superpowers/plans/2026-07-28-mouse-first-workspace.md (PR #617, IMPLEMENTED): mouse users could not interrupt before; they still cannot submit in terminal view.

Intended behavior

  • When mouseModeEnabled is on, AgentTerminalLeaf renders a thin action row below the xterm with a Submit button.
  • Clicking Submit sends '\r' (Enter) to the agent PTY via the existing window.api.sendInput(sessionId, ...) path — the exact byte xterm emits for Enter.
  • It must NOT read, clear, or invent any draft (runtime.draftInput and feed state are untouched). Raw terminals have no readable "current line", so the button is always enabled, like a hardware Enter key.
  • onMouseDown preventDefault so the click never steals xterm focus.
  • Scope: agent terminal panes only (AgentTerminalLeaf). Plain shell panes (TerminalLeaf) keep zero controls — ordinary shell behavior is preserved. Stop button is out of scope (interrupt semantics differ per TUI).

Acceptance criteria

  • New colocated renderer component/test for the action row.
  • Row mounts only when mouseModeEnabled; zero layout change when off.
  • Submit sends '\r' to the agent PTY; no draft/composer state is touched.
  • TerminalLeaf byte-identical (no control added to plain shells).
  • npm run typecheck and npm run test:renderer pass.
  • Open reviewable PR referencing this issue; do not merge without user confirmation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions