Selecting text in the terminal deselects immediately #51

Closed
opened 2026-10-12 16:35:18 -04:00 by jared · 0 comments
Owner

Cause: tmux runs with the mouse on, so the wheel can scroll its history. That also routes a plain drag into tmux copy-mode, which copies over OSC 52 and leaves copy-mode on release, dropping the highlight at once. You couldn't tell anything was copied. Only Shift+drag gave a browser selection.

Fix:

  • A left-button drag in the pane becomes a browser selection (what Shift+drag does). It stays highlighted and is copied on release, with a short "Copied N characters" toast. Double-click (word) and triple-click (line) work too.
  • Ctrl+C copies the selection when there is one, and interrupts only when nothing is selected.
  • The mouse wheel still scrolls tmux history, and clicks on the tmux status line (window tabs) still go to tmux.
  • The footer hint reads "drag copy", and the key help lists Drag and Ctrl+C.
**Cause:** tmux runs with the mouse on, so the wheel can scroll its history. That also routes a plain drag into tmux copy-mode, which copies over OSC 52 and leaves copy-mode on release, dropping the highlight at once. You couldn't tell anything was copied. Only Shift+drag gave a browser selection. **Fix:** - A left-button drag in the pane becomes a browser selection (what Shift+drag does). It stays highlighted and is copied on release, with a short "Copied N characters" toast. Double-click (word) and triple-click (line) work too. - Ctrl+C copies the selection when there is one, and interrupts only when nothing is selected. - The mouse wheel still scrolls tmux history, and clicks on the tmux status line (window tabs) still go to tmux. - The footer hint reads "drag copy", and the key help lists Drag and Ctrl+C.
jared closed this issue 2026-10-12 16:35:27 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/devdesk#51