Repository navigation
Closed
Labels
enhancementNew feature or requesttuimecatui terminal UI (rendering, keybindings, footer, panes, scrollback)
Description
Summary
In the TUI prompt input you cannot select a range of text with the mouse to edit it. You should be able to click-drag inside the prompt to highlight a run of text, then delete it, replace it, or have typing replace the selection — the standard GUI editing behavior.
This is the deliberate follow-up to #490, which ships click-to-position caret but explicitly cuts in-input selection ("No word-select in the input in v1 (deliberate cut)"). #490 is the caret; this is the selection.
Behavior requested
- Click-drag inside the prompt input → highlight the covered range (from the press cell to the release/drag cell).
- Delete/backspace with an active selection → removes the selection.
- Typing (or paste) with an active selection → replaces it.
- Standard escape hatches: click elsewhere / arrow keys collapse the selection to the caret.
- Scope is the prompt textarea only. Drag-selection over the conversation viewport (copy-out) already exists and is unchanged.
Grounding
- Alt-screen mouse is already captured; drag/motion/release are routed in
cmd/mecatui/ui/update.go(MouseMotionMsg/MouseReleaseMsg, ~update.go:260), and the conversation viewport already implements drag-selection (cmd/mecatui/ui/selection.go,graphemeColForCellX). - Caret/cell→(row, rune-col) mapping is the shared hard part with mecatui: click-to-position caret in prompt textarea #490 (bubbles textarea soft-wrap via unexported
memoizedWrap, rune-width-aware). This issue depends on that mapping; sequence after mecatui: click-to-position caret in prompt textarea #490 so the press/drag endpoints reuse the same cell→position helper rather than duplicating it. - Component gap to verify: bubbles
textarea(v1.0.0 ingo.mod) exposesSetCursor/SetCursorColumnand cursor movement but no selection model (no selection anchor/range, no "delete selection", no type-over-replace). So this likely needs either a local selection layer wrapping the textarea, or upstreaming selection support to bubbles. Flagging so this isn't scoped as "just wire drag events." - Respects
--no-mouse(selection.go:105); extendMECATUI_DEBUG_MOUSEto show the selection range.
Open questions
- Local selection overlay vs. upstream a
textareaselection API to bubbles (mirrors mecatui: click-to-position caret in prompt textarea #490's "replicate locally vs. upstreamPositionAtCell" choice — ideally decided together). - Interaction with existing viewport drag-selection: a drag that starts in the input stays an input selection; decide behavior for a drag that crosses region boundaries (clamp to the region it started in).
- Word-select on double-click / line-select on triple-click — v2, note but don't require.
Acceptance criteria
- Click-drag in the prompt highlights the covered range using the mecatui: click-to-position caret in prompt textarea #490 cell→position mapping.
- Delete/backspace removes the selection; typing/paste replaces it.
- Arrow keys / click elsewhere collapse the selection.
- Soft-wrapped and scrolled buffers select correctly; empty buffer → no-op.
- Conversation-viewport selection is unaffected;
--no-mousedisables it.
Related
- Depends on / follow-up to mecatui: click-to-position caret in prompt textarea #490 (click-to-position caret — shares the cell→position mapping).
- mecatui: mouse interactions beyond drag-selection (links, approval buttons, textarea caret) #486 (closed) / feat(mecatui): clickable permission + plan-review buttons #496 (merged) — other mouse interactions; drag-selection changes were out of scope there.
- Text input prevents/bans inputting text by primary selection #43 (closed) — different issue (primary-selection paste ban), not drag-to-select.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requesttuimecatui terminal UI (rendering, keybindings, footer, panes, scrollback)
Activity
feat(mecatui): support prompt text selection (#770)
feat(mecatui): support prompt text selection (#841)
jbeda commentedon Aug 31, 2026
I think this one is done. Let me know if more needs to be done here.