[PR #13516] Make selection have an exclusive end #29602

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

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

State: closed
Merged: No


Summary of the Pull Request

Selection is generally stored as a range of start and end where start <= end. However, this prevents the ability to have a selection be an empty range denoting the space between two cells. To fix this, we need to make the end exclusive.

References

Epic: #4993
Closes #13447

Detailed Description of the Pull Request / Additional comments

TODO CARLOS: I'll write this at some point, I swear.

Validation Steps Performed

  • Rendering the selection

  • Copying the selection

  • Selection markers

  • Keyboard Selection

mode left right up down
char cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
word cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
view cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
buffer cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
cursor: ✅
start: ✅
end: ✅
  • Mouse selection
# of clicks no movement click + drag shift + click
1 ✅ ✅ ✅
2 ✅ ❓ ✅
3 ✅ ❓ ✅
  • Block selection

    • alt + drag mouse
    • keyboard selection
  • Corner cases:

    • wide glyphs
    • scrolling when keyboard selection goes to the top/bottom edge
    • click +drag to the left/right edge
    • keyboard selection when wrapping off the left/right edge
**Original Pull Request:** https://github.com/microsoft/terminal/pull/13516 **State:** closed **Merged:** No --- ## Summary of the Pull Request Selection is generally stored as a range of `start` and `end` where `start <= end`. However, this prevents the ability to have a selection be an empty range denoting the space between two cells. To fix this, we need to make the `end` exclusive. ## References Epic: #4993 Closes #13447 ## Detailed Description of the Pull Request / Additional comments TODO CARLOS: I'll write this at some point, I swear. ## Validation Steps Performed - [X] Rendering the selection - [X] Copying the selection - [X] Selection markers - Keyboard Selection | mode | left | right | up | down | |--|--|--|--|--| | char | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | | word | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | | view | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | | buffer | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | cursor: ✅ <br/> start: ✅ <br/> end: ✅ | - Mouse selection | # of clicks | no movement | click + drag | shift + click | |--|--|--|--| | 1 | ✅ | ✅ | ✅ | | 2 | ✅ | ❓ | ✅ | | 3 | ✅ | ❓ | ✅ | - Block selection - [X] alt + drag mouse - [X] keyboard selection - Corner cases: - [ ] wide glyphs - [ ] scrolling when keyboard selection goes to the top/bottom edge - [ ] click +drag to the left/right edge - [X] keyboard selection when wrapping off the left/right edge
claunia added the pull-request label 2026-01-31 09:35:51 +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#29602