A recent patch 634f4928 introduced new tty behavior,

where calling term_start_color(NO_COLOR) would have the same
effect as calling term_end_color().

That change only included a change for termcap, but not any of
the NO_TERMS configurations. (NO_TERMS is defined for an
implementation where termcap is not used).

This attempts to make sys/msdos/video.c and sys/windows/consoletty.c
honor the change.

The msdos change has not yet been tested.

No attempt was made to alter the term_start_color() implementations
within the outdated tree.
This commit is contained in:
nhmall
2023-12-07 09:34:05 -05:00
parent 5c5a5cf2cc
commit e639c4bdaa
2 changed files with 8 additions and 3 deletions

View File

@@ -354,7 +354,10 @@ term_start_color(int color)
if (monoflag) {
g_attribute = attrib_text_normal;
} else {
if (color >= 0 && color < CLR_MAX) {
if (color == NO_COLOR) { /* 3.7 behave like term_end_color() */
g_attribute = iflags.grmode ? attrib_gr_normal : attrib_text_normal;
curframecolor = NO_COLOR;
} else if (color >= 0 && color < CLR_MAX) {
if (iflags.grmode)
g_attribute = color;
else

View File

@@ -1747,7 +1747,9 @@ term_start_raw_bold(void)
void
term_start_color(int color)
{
if (color >= 0 && color < CLR_MAX) {
if (color == NO_COLOR) {
term_end_color();
} else if (color >= 0 && color < CLR_MAX) {
console.current_nhcolor = color;
} else {
console.current_nhcolor = NO_COLOR;
@@ -1757,7 +1759,7 @@ term_start_color(int color)
void
term_start_bgcolor(int color)
{
if (color >= 0 && color < CLR_MAX) {
if (color != NO_COLOR && (color >= 0 && color < CLR_MAX)) {
console.current_nhbkcolor = color;
} else {
console.current_nhbkcolor = NO_COLOR;