Skip to content

fix(terminal): enable drag-to-select in tmux control mode#325

Merged
eyelock merged 2 commits into
developfrom
fix/tmux-control-select-text
May 13, 2026
Merged

fix(terminal): enable drag-to-select in tmux control mode#325
eyelock merged 2 commits into
developfrom
fix/tmux-control-select-text

Conversation

@eyelock
Copy link
Copy Markdown
Owner

@eyelock eyelock commented May 13, 2026

Summary

  • ControlModeTerminalView is a bare TerminalView subclass and never had the allowMouseReporting toggle from TermQTerminalView. Without it, SwiftTerm's mouseDragged short-circuits on the inner TUI's mouse mode and feedPrepare() clears any nascent selection on every output burst — visible as "can't select text while Claude is thinking" in tmux-control panes.
  • Extracted the drag-to-select logic (event monitors, allowMouseReporting toggle, auto-scroll timer, linefeed/selectionChanged/scrolled override behavior) from TermQTerminalView into a new TerminalSelectionDragController. TermQTerminalView and ControlModeTerminalView each own one and forward their three SwiftTerm overrides into it.
  • Composition rather than a shared base class because TermQTerminalView inherits from LocalProcessTerminalView and ControlModeTerminalView from TerminalView — no common Swift ancestor we can extend.

Test plan

  • swift package clean && make check — clean build, lint clean (no new violations), format clean, tests pass
  • Manual: Direct backend drag-select still works
  • Manual: tmux-attach backend drag-select still works
  • Manual: tmux-control backend drag-select now works while Claude TUI is thinking/compacting

🤖 Generated with Claude Code

David Collie and others added 2 commits May 13, 2026 21:32
ControlModeTerminalView is a bare TerminalView subclass and never had the
allowMouseReporting toggle that lets users select text in panes whose
inner app has mouse mode on (e.g. Claude Code TUI). Without it,
SwiftTerm's mouseDragged short-circuits on the inner app's mouse mode
and feedPrepare() clears any nascent selection on every output burst —
visible as "can't select while Claude is thinking" in tmux-control
panes.

Extract the drag-to-select logic (event monitors, allowMouseReporting
toggle, auto-scroll timer, linefeed/selectionChanged/scrolled overrides)
from TermQTerminalView into a new TerminalSelectionDragController.
TermQTerminalView and ControlModeTerminalView each own one and forward
their three SwiftTerm overrides into it. Behavior in Direct and
tmux-attach (which both use TermQTerminalView) is unchanged; tmux-control
panes now get the same drag-to-select support.

Composition rather than a shared base class because TermQTerminalView
inherits from LocalProcessTerminalView and ControlModeTerminalView from
TerminalView — no common Swift ancestor we can extend.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@eyelock eyelock merged commit f786fca into develop May 13, 2026
7 checks passed
@eyelock eyelock deleted the fix/tmux-control-select-text branch May 13, 2026 20:41
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