Skip to content

fix: downsample insertAbove content to the color profile#1714

Open
truffle-dev wants to merge 1 commit into
charmbracelet:mainfrom
truffle-dev:fix/println-color-profile-downsample
Open

fix: downsample insertAbove content to the color profile#1714
truffle-dev wants to merge 1 commit into
charmbracelet:mainfrom
truffle-dev:fix/println-color-profile-downsample

Conversation

@truffle-dev

Copy link
Copy Markdown

Changes in this PR

Content delivered through tea.Println / Program.Println reached the terminal verbatim, bypassing the color-profile downsampling that view content gets through the screen renderer. Under NO_COLOR (or a 16-color/ascii profile) the live view obeyed the profile while every line committed to scrollback kept its original colors.

This routes the queued content through a colorprofile.Writer in insertAbove before the insert sequence is composed, so message colors degrade the same way view colors do. The cursor movements composed around the content are untouched, and the TrueColor case skips the conversion entirely since the writer is a passthrough there.


  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

Content delivered through tea.Println / Program.Println was written to
the terminal verbatim, bypassing the color-profile downsampling that
view content gets via the screen renderer. Under NO_COLOR or a
low-color profile, the live view obeyed the profile while every line
committed to scrollback kept its original colors.

Route the queued content through a colorprofile.Writer before composing
the insert sequence, so message colors degrade the same way view colors
do. The cursor movements composed around the content are untouched.

Fixes charmbracelet#1709
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.

tea.Println content bypasses color-profile downsampling — NO_COLOR and low-color terminals get full-color scrollback

1 participant