Skip to content

P2: Search terminal output and send selected failures into the composer #1185

Closed

Description

@currentbits

Audit #1180, 2026-09-10. Baseline: checkout 9fc8645; fetched origin/main bf6fb02 has identical relevant implementation. This is implementation backlog, not a shipped fix.

Gap

src/components/TerminalPane.tsx exposes cwd, shell state, Restart and a command input. It lacks Find, Clear display or a selection-to-composer action. Its props only accept threadId/API, so it cannot hand a selected test failure to the conversation.

Change

Add a compact toolbar for Find, Clear display, Copy selection and Send selection to composer. Reuse existing composer context insertion. Preserve native selection. Find supports next/previous and Escape. Clear display does not kill the shell. Sending selection preserves the user's draft and inserts marked terminal context for review; it never auto-submits or starts an agent.

Acceptance

  • Select multiline failing-test output and insert it into the same thread's composer in one action without replacing a draft.
  • No selection disables the action or explains what to select; never upload the whole buffer by accident.
  • Find navigates retained output and reports no matches.
  • Clear display preserves the shell and running command; new output appears once.
  • Controls work in narrow splits and have accessible names/focus.
  • Actions use current thread/session ownership. Coordinate the selection interface with the PTY upgrade to avoid duplicate implementation.

Related #147 proposed selection handoff but shipped a minimal pipe pane. #253 is unsolicited automatic suggestions; this is a user action. Transcript-wide Find/Copy stay in existing #486 and #493.

Activity

  1. added and removed on Oct 15, 2026
  2. currentbits commented on Oct 15, 2026

    @currentbits
    OwnerAuthor

    Implemented in a9faa81 on coder/p2-search-terminal-output-and-send-selec-4997be (not merged yet).

    • Each split's toolbar now has Find, Clear, Copy and To composer buttons.
    • To composer adds a typed terminal context chip through the existing setContextChips (Typed context chips: @threads, @PRs, @skills, terminal selections, several quotes with comments #1526) for the pane's own thread. The draft text is left alone, nothing is sent, and no run starts. The button is disabled with a "Select output in the terminal first" tooltip when nothing is selected, and only the selection is ever sent. Archived threads and the sign-in terminal get no button.
    • Find scans the retained xterm buffer: Enter searches up, Shift+Enter searches down, Escape closes, and a miss shows "No matches" in a live region. No new dependency. Known limits: a match split across a soft-wrapped line is missed, and the highlight is offset after wide (CJK) characters. @xterm/addon-search fixes both.
    • Clear calls xterm clear() only, so the PTY, the running command and the main-process scrollback are untouched.
    • In narrow splits the toolbar wraps instead of overflowing.

    Verified with real xterm on a scratch page (4 splits, 900px): a multiline drag-selection goes to the composer intact. That check caught a bug the unit tests couldn't: the status text reflowed the toolbar, xterm refit, and the resize cleared the selection. Fixed by floating the status over the screen. Full test:renderer: 3080 pass, 0 fail; tsc and vite build are clean.

    Not done: there is no ⌘F shortcut inside the terminal yet; Find is button-only.

  3. added and removed on Oct 15, 2026
  4. currentbits commented on Oct 15, 2026

    @currentbits
    OwnerAuthor

    Landed from Solenta thread "P2: Search terminal output and send selected failures into t" (PR #1638). Closed on merge.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions