Simplify Tc/COLORTERM=truecolor escape sequence

This should be more readable to most people, since C is
more widely familiar than the terminfo language.
* src/term.c (init_tty): Do the conversion from a single integer
24-bit color value to three 8-bit RGB values up-front.
(Bug#70941)
This commit is contained in:
Peter Oliver 2026-04-22 13:04:44 +01:00 committed by Eli Zaretskii
parent 8aa7f6a501
commit 74d411d600

View file

@ -4635,9 +4635,10 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
|| ((bg = getenv ("COLORTERM")) != NULL
&& strcasecmp (bg, "truecolor") == 0))
{
tty->TS_set_foreground = "\033[38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m";
tty->TS_set_background = "\033[48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m";
tty->TS_set_foreground = "\033[38;2;%p1%d;%p2%d;%p3%d%;m";
tty->TS_set_background = "\033[48;2;%p1%d;%p2%d;%p3%d%;m";
tty->TN_max_colors = 16777216;
tty->TF_rgb_separate = 1;
}
}
#endif