Skip to content

Stop following output while a region is active in semi-char mode - #696

Merged
dakra merged 1 commit into
mainfrom
fix/region-survives-anchor
Sep 17, 2026
Merged

dakra merged 1 commit into
mainfrom
fix/region-survives-anchor

Conversation

@dakra

@dakra dakra commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

A mouse selection left active in semi-char mode (ghostel-mouse-drag-input-mode nil) grew to the prompt whenever the window was resized or output arrived: the window kept following, so ghostel--anchor-window snapped point to the live cursor while the mark stayed put. Window resize hits this through ghostel--adjust-size, and any redraw through ghostel--redraw-now, so it was not resize-specific.

ghostel--window-follows-p now vetoes following for semi-char and char mode while the region is active, as Emacs mode already does. Such a window is left alone by output and resizes; the next keystroke clears the region and re-anchors (#674).

With the default settings a region in semi-char only exists during the drag itself, so the common copy-mode path is unaffected.

Verified live under elate: region survives a window split, delayed output, and a 40-line flood that pushes the cursor off-screen; a subsequent keystroke deactivates the mark and re-anchors. Default config: drag enters copy mode, exit lands in semi-char with point on the cursor, later output anchors normally.

Fixes #695.

A mouse selection left active in semi-char mode (ghostel-mouse-drag-input-mode
nil) grew to the prompt whenever the window was resized or output arrived:
the window kept following, so ghostel--anchor-window snapped point to the
live cursor while the mark stayed put.  Veto following while the region is
active, as Emacs mode already does; the next keystroke clears the region
and re-anchors.

Fixes #695.
@dakra
dakra force-pushed the fix/region-survives-anchor branch from ddb423d to 1a5bea8 Compare September 17, 2026 13:07
@dakra dakra changed the title Keep point across anchoring while the region is active Stop following output while a region is active in semi-char mode Sep 17, 2026
@dakra
dakra force-pushed the fix/region-survives-anchor branch from 1a5bea8 to 026e345 Compare September 17, 2026 14:18
@dakra
dakra merged commit 026e345 into main Sep 17, 2026
27 checks passed
@dakra
dakra deleted the fix/region-survives-anchor branch September 17, 2026 14:18

This branch was successfully deployed

1 active deployment
github-pages — 026e345c Deployed Sep 17, 2026 by dakra via deploy #196
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.

Mouse selection extended to shell prompt after window resize

1 participant