mark mode: begin selection at viewport when scrolled up#19549
Merged
carlos-zamora merged 1 commit intomainfrom Nov 11, 2025
Merged
mark mode: begin selection at viewport when scrolled up#19549carlos-zamora merged 1 commit intomainfrom
carlos-zamora merged 1 commit intomainfrom
Conversation
lhecker
approved these changes
Nov 11, 2025
carlos-zamora
added a commit
that referenced
this pull request
Nov 18, 2025
## Summary of the Pull Request Searching in terminal highlights all search results. However, those results are considered separate from a selection. In the past, the highlighted result would be selected, resulting in it being the initial position for mark mode. Now that it's separate, mark mode doesn't start there. To fix this, there's 2 changes here: 1. When we exit the search, we now select the focused search result. This becomes the initial position for mark mode. 2. When we're in the middle of a search and mark mode becomes enabled, the focused search result becomes the initial position for mark mode. With this change, mark mode's initial position is determined in this order: 1. the position of an active selection 2. the position of the focused search result (if one is available) 3. the top-left position of the viewport (if there is a scrollback) (see #19549) 4. the current cursor position ## Validation Steps Performed Entering mark mode in scenario X results in a starting position of Y: ✅ selected text during a search --> selected text - NOTE: this seems to only occur if you start a search, then manually click on the terminal to bring focus there, but keep the search results active ✅ performed a search and results are available -->focused search result ✅ performed a search and no results are available - scrolled up --> top-left of viewport - no scrollback --> cursor position ✅ performed a search, got results, then closed search --> focused search result Closes #19358
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.
Summary of the Pull Request
Updates mark mode so that it starts at the viewport's origin (top-left) if we're not scrolled to the bottom. This is based on the discussion in #19488.
Validation Steps Performed
✅ scrolled at bottom --> mark mode starts at cursor
✅ scrolled up --> mark mode starts at cursor
Closes #19488