File: src/server/server.zig:1637-1641 (press), src/server/server.zig:1662-1671 (release)
Severity: MEDIUM
Status: ✅ FIXED
The copy-mode press handler starts a selection and records anchor press coords
(Server.copy_click_x/y) whenever !cm.selection.active or !m.drag. On
release:
!moved, bare single click): calls
cm.clearSelection() so the zero-extent selection is dropped, leaving the
mode active with no pending selection and no buffer pushed.Test: bare click in copy-mode stays in mode, drag still yanks — bug #379
(asserts press/release at identical coords keeps copy-mode active and resets
selection.active; consecutive bare clicks at different locations remain in
mode without yanking; drag across cells yanks one buffer and exits).
if (!cm.selection.active) cm.startSelection();if (cm.selection.active) { yank…; pane.screen.copy_mode = null; }A bare click starts a zero-extent selection, then release yanks it (a single character or empty string after the trailing-space trim at mode_copy.zig:384-386) onto the paste-buffer stack and kicks the user out of copy mode. Without clearing the selection on a non-moving release, subsequent bare clicks or keyboard motions erroneously treated the selection as active.
On release require actual movement since press (compare cursor_x/y at press,
stored alongside start_scroll_offset) before yank+exit; a no-move release
should just clear the selection highlight (clearSelection) and stay in copy-mode.