diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/term.c | 10 | ||||
| -rw-r--r-- | src/tparam.h | 3 | 
2 files changed, 11 insertions, 2 deletions
diff --git a/src/term.c b/src/term.c index b3707da70a2..64a2b7e5519 100644 --- a/src/term.c +++ b/src/term.c @@ -4144,10 +4144,10 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\        tty->TN_max_colors = tgetnum ("Co");  #ifdef TERMINFO -      /* Non-standard support for 24-bit colors. */        {  	const char *fg = tigetstr ("setf24");  	const char *bg = tigetstr ("setb24"); +	/* Non-standard support for 24-bit colors. */  	if (fg && bg  	    && fg != (char *) (intptr_t) -1  	    && bg != (char *) (intptr_t) -1) @@ -4156,6 +4156,14 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\  	    tty->TS_set_background = bg;  	    tty->TN_max_colors = 16777216;  	  } +	/* Standard support for 24-bit colors.  */ +	else if (tigetflag ("RGB") > 0) +	  { +	    /* If the used Terminfo library supports only 16-bit +	       signed values, tgetnum("Co") and tigetnum("colors") +	       could return 32767.  */ +	    tty->TN_max_colors = 16777216; +	  }        }  #endif diff --git a/src/tparam.h b/src/tparam.h index f8fb9e08690..3a3cb52c178 100644 --- a/src/tparam.h +++ b/src/tparam.h @@ -37,7 +37,8 @@ extern char *BC;  extern char *UP;  #ifdef TERMINFO -char *tigetstr(const char *); +int tigetflag (const char *); +char *tigetstr (const char *);  #endif  #endif /* EMACS_TPARAM_H */  | 
