Skip to content

Fix the highlights - #697

Open
adi07das wants to merge 1 commit into
mpfaffenberger:mainfrom
adi07das:fix/selection-contrast
Open

Fix the highlights#697
adi07das wants to merge 1 commit into
mpfaffenberger:mainfrom
adi07das:fix/selection-contrast

Conversation

@adi07das

@adi07das adi07das commented Aug 3, 2026

Copy link
Copy Markdown

Currently, the users face an issue with the highlight which hides the content being highlighted due the highlight color and the rendered content font colors.

Current:
Screenshot 2026-08-03 at 2 17 33 PM

Screenshot 2026-08-03 at 2 19 20 PM

After the change:

Screenshot 2026-08-03 at 2 17 47 PM

Co-author: aditya.das@walmart.com

…onses

_render_agent_response was applying the active theme's soft foreground
(e.g. Tokyo Night's #a9b1d6) to every rendered markdown cell. Any user
whose terminal draws its text selection with a pale background color got
the classic light-on-light collapse: highlighted text became unreadable
while dragging to copy, with only bold cells (headings/code) surviving.

The original override existed to work around terminals that ignore OSC 10
and leak their profile's white through Rich resets. That was a cosmetic
issue for a subset of terminals; the selection contrast bug hits every
terminal + every user + every drag.

Flip the default: let the terminal keep its own default foreground so
its selection inversion works. Preserve the legacy behavior behind a new
'selection_friendly_transcript' config key (default true, set to false to
restore the OSC-10 workaround).

Tests: covers both branches by asserting whether Rich console.print
receives a 'style' kwarg.
@adi07das

adi07das commented Aug 6, 2026

Copy link
Copy Markdown
Author

@mpfaffenberger - please help review this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant