Repository navigation
Clear the region on explicit terminal input - #682
Merged
Merged
Conversation
Terminal input goes to the PTY, not the buffer, so a mouse selection left active in semi-char mode (ghostel-mouse-drag-input-mode nil) survived the keystroke and grew to the prompt when point snapped to the live cursor. Deactivate the mark in ghostel--on-user-input, the choke point every explicit input path runs through. Fixes #674.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #674.
With
ghostel-mouse-drag-input-modeset to nil, a mouse drag leaves the mark active in semi-char mode. Typing then writes to the PTY without touching the buffer, so nothing deactivates the mark, and the input hook snaps point to the live cursor: the region grows from the drag start to the prompt.ghostel--on-user-inputnow callsdeactivate-mark. It is the choke point for every explicit input path (self-insert,ghostel-send-key, paste, theC-c/C-dsenders, middle-click paste, evil-ghostel's terminal-bound ESC), so typing dismisses a selection the way a terminal does. Copy/Emacs mode already deactivate on exit; line mode and evil visual operators never route through the hook.Verified live under elate (zsh, Emacs 32 TTY): with the old body the region persists and extends to the prompt after a keystroke; with this change it clears and point lands on the cursor. The default copy-mode drag path still enters copy mode and exits cleanly on the next key.