aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTim Ruffing2021-11-11 07:14:57 +0100
committerLars Ingebrigtsen2021-11-11 07:14:57 +0100
commitf30f53115928fd65d066944d53d07742b0807670 (patch)
tree89b054324753f26dfe155ed15071081fe64ca562 /src
parent894dd18804ef766a87ffa4b4109125b4661651be (diff)
downloademacs-f30f53115928fd65d066944d53d07742b0807670.tar.gz
emacs-f30f53115928fd65d066944d53d07742b0807670.zip
Support Tc terminfo flag for 24-bit color support in terminal
* src/term.c (init_tty): Use the Tc flag (bug#44950). Copyright-paperwork-exempt: yes
Diffstat (limited to 'src')
-rw-r--r--src/term.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/term.c b/src/term.c
index 6f0b827cfc8..d86ae12ba84 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4152,10 +4152,12 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
4152 could return 32767. */ 4152 could return 32767. */
4153 tty->TN_max_colors = 16777216; 4153 tty->TN_max_colors = 16777216;
4154 } 4154 }
4155 /* Fall back to xterm+direct (semicolon version) if requested 4155 /* Fall back to xterm+direct (semicolon version) if Tc is set
4156 by the COLORTERM environment variable. */ 4156 (de-facto standard introduced by tmux) or if requested by
4157 else if ((bg = getenv("COLORTERM")) != NULL 4157 the COLORTERM environment variable. */
4158 && strcasecmp(bg, "truecolor") == 0) 4158 else if (tigetflag("Tc")
4159 || ((bg = getenv("COLORTERM")) != NULL
4160 && strcasecmp(bg, "truecolor") == 0))
4159 { 4161 {
4160 tty->TS_set_foreground = "\033[%?%p1%{8}%<%t3%p1%d%e38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m"; 4162 tty->TS_set_foreground = "\033[%?%p1%{8}%<%t3%p1%d%e38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m";
4161 tty->TS_set_background = "\033[%?%p1%{8}%<%t4%p1%d%e48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m"; 4163 tty->TS_set_background = "\033[%?%p1%{8}%<%t4%p1%d%e48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m";