Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to SGR when rendering 16/256 colors when MaxColors is 16M #4530

Merged
merged 1 commit into from
Nov 4, 2023

Conversation

quark-zju
Copy link
Contributor

When MaxColors is 16M, the "palette index" is treated by "setaf" as a true color, not the classic 256 color. Users of PaletteIndex expects 256 color and let's fallback to SGR.

For example, setaf on tmux-direct is:

setaf=\E[%?%p1%{8}%<%t3%p1%d%e38:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%d%;m,

It only special treats the first 8 colors (which means rgb(0,0,0..8) cannot be rendered with setaf).

Related: #4528

When MaxColors is 16M, the "palette index" is treated by "setaf" as a true color, not the classic 256 color. Users of `PaletteIndex` expects 256 color and let's fallback to SGR.

For example, setaf on tmux-direct is:

    setaf=\E[%?%p1%{8}%<%t3%p1%d%e38:2::%p1%{65536}%/%d:%p1%{256}%/%{255}%&%d:%p1%{255}%&%d%;m,

It only special treats the first 8 colors (which means `rgb(0,0,0..8)` cannot be rendered with `setaf`).
@wez wez merged commit 2a02239 into wez:main Nov 4, 2023
17 of 19 checks passed
@wez
Copy link
Owner

wez commented Nov 4, 2023

Thanks!

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.

2 participants