[PR #13045] Add ability to select all text in the buffer #29359

Open
opened 2026-01-31 09:34:26 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/13045

State: closed
Merged: Yes


Adds the selectAll action which can be used to select all text in the buffer (regardless of whether a selection is present).

References

#3663 - Mark Mode
#4993 - [Scenario] Keyboard selection

PR Checklist

Detailed Description of the Pull Request / Additional comments

I've made it such that selecting the "entire buffer" really just selects up to the mutable viewport. This seems like a nice QOL improvement since there's generally nothing past that.

When the user selects all, the viewport does not move. This is consistent with CMD behavior and is intended to allow the user to not lose context when selecting everything.

A minor change had to be made to the DxRenderer because this uncovered an underflow issue. Basically, the selection rects were handed to the DxEngine relative to the viewport (which means that some had a negative y-value). At some point, those rects were stored into size_ts, resulting in an underflow issue. This caused the renderer to behave strangely when rendering the selection. Generally, these kinds of issues weren't really noticed because selection would always modify a portion of the viewport.

Funny enough, in a way, this satisfies the "mark mode" scenario because the user now has a way to initiate a selection using only the keyboard. Though this isn't ideal, just a fun thing to point out (that's why I'm not closing the mark mode issue).

Validation Steps Performed

  • Verified using DxEngine and AtlasEngine
  • select all --> keyboard selection --> start moving the top-left endpoint (and scroll to there)
  • select all --> do not scroll automatically
**Original Pull Request:** https://github.com/microsoft/terminal/pull/13045 **State:** closed **Merged:** Yes --- Adds the `selectAll` action which can be used to select all text in the buffer (regardless of whether a selection is present). ## References #3663 - Mark Mode #4993 - [Scenario] Keyboard selection ## PR Checklist * [x] Closes #1469 * [x] Tests added/passed ## Detailed Description of the Pull Request / Additional comments I've made it such that selecting the "entire buffer" really just selects up to the mutable viewport. This seems like a nice QOL improvement since there's generally nothing past that. When the user selects all, the viewport does not move. This is consistent with CMD behavior and is intended to allow the user to not lose context when selecting everything. A minor change had to be made to the DxRenderer because this uncovered an underflow issue. Basically, the selection rects were handed to the DxEngine relative to the viewport (which means that some had a negative y-value). At some point, those rects were stored into `size_t`s, resulting in an underflow issue. This caused the renderer to behave strangely when rendering the selection. Generally, these kinds of issues weren't really noticed because selection would always modify a portion of the viewport. Funny enough, in a way, this satisfies the "mark mode" scenario because the user now has a way to initiate a selection using only the keyboard. Though this isn't ideal, just a fun thing to point out (that's why I'm not closing the mark mode issue). ## Validation Steps Performed - Verified using DxEngine and AtlasEngine - select all --> keyboard selection --> start moving the top-left endpoint (and scroll to there) - select all --> do not scroll automatically
claunia added the pull-request label 2026-01-31 09:34:26 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#29359