Fix text selection styling#677
Merged
dgageot merged 1 commit intodocker:mainfrom Nov 1, 2025
Merged
Conversation
Signed-off-by: Deepam02 <116721751+Deepam02@users.noreply.github.com>
Contributor
Author
rumpl
approved these changes
Nov 1, 2025
Member
rumpl
left a comment
There was a problem hiding this comment.
Amazing!
I started looking at this last night but I ended up with something that was 200 lines more complex and didn’t work.
Thanks!
Member
|
Would it be possible to also keep the styling on the selected text? Not sure how good that will look though. I’m curious to see how code selection looks like too |
Contributor
Author
|
I experimented with keeping the original styling visible when text is selected, but it didn’t work out cleanly. The problem is that when you layer a background color over existing ANSI color codes, it either wipes out the foreground colors or fails to apply properly. |
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 #665
Replaced string manipulation logic to use
ansi.Cut()which preserves ANSI escape codes (colors, formatting) in unselected text segments while applying selection styling only to the selected portion.