"Color selection" off-by-one regression: it colors 1 cell past the end #23090

Closed
opened 2026-01-31 08:32:01 +00:00 by claunia · 2 comments
Owner

Originally created by @jazzdelightsme on GitHub (Mar 28, 2025).

Originally assigned to: @carlos-zamora on GitHub.

Windows Terminal version

1.23.10732.0

Windows build number

10.0.26388.1001

Other Software

No response

Steps to reproduce

I use the "Color Selection" feature a lot, and often the "all matches" variant, which lets you select some text, and then change the fg/bg color for all occurrences of the selected text.

Recently it started coloring one cell past the end of the selection. In the screenshot below, I selected "abcd", but the colorization applies to "abcde" (as well as "abcdeX", demonstrating that the search is not similarly afected):

Image

Expected Behavior

Just the "abcd" should have been colorized.

Actual Behavior

Colorization included one character past the end.

Originally created by @jazzdelightsme on GitHub (Mar 28, 2025). Originally assigned to: @carlos-zamora on GitHub. ### Windows Terminal version 1.23.10732.0 ### Windows build number 10.0.26388.1001 ### Other Software _No response_ ### Steps to reproduce I use the "Color Selection" feature a lot, and often the "all matches" variant, which lets you select some text, and then change the fg/bg color for all occurrences of the selected text. Recently it started coloring one cell past the end of the selection. In the screenshot below, I selected "abcd", but the colorization applies to "abcde" (as well as "abcdeX", demonstrating that the search is not similarly afected): ![Image](https://github.com/user-attachments/assets/6258a18f-d941-443d-9f3e-c7fd6750dbe3) ### Expected Behavior Just the "abcd" should have been colorized. ### Actual Behavior Colorization included one character past the end.
Author
Owner

@jazzdelightsme commented on GitHub (Mar 28, 2025):

As we all know, the two hardest things in computer science are naming things, cache invalidation, and off-by-one errors. :D

@jazzdelightsme commented on GitHub (Mar 28, 2025): As we all know, the two hardest things in computer science are naming things, cache invalidation, and off-by-one errors. :D
Author
Owner

@DHowett commented on GitHub (Mar 28, 2025):

Alas, another victim of #18106

@DHowett commented on GitHub (Mar 28, 2025): Alas, another victim of #18106
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23090