aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Beich2020-06-14 03:51:24 +0000
committerEli Zaretskii2020-06-20 11:16:14 +0300
commit50f489b5dc59ba8eacd6dc5bdee98da690a61f2f (patch)
tree0d14e5c3931116e3bc2f98a45dc8c24dee7cf429 /src
parented08512978812220045ff12941d78b99ed32323f (diff)
downloademacs-50f489b5dc59ba8eacd6dc5bdee98da690a61f2f.tar.gz
emacs-50f489b5dc59ba8eacd6dc5bdee98da690a61f2f.zip
Add fallback for 24-bit terminal color via COLORTERM=truecolor
* src/term.c (init_tty): When COLORTERM=truecolor is defined, override setaf/setab/colors terminfo capabilities with 24-bit color support. * doc/misc/efaq.texi (Colors on a TTY): Mention the possibility to enable 24-bit color via the COLORTERM environment variable. (Bug#41846) Copyright-paperwork-exempt: yes
Diffstat (limited to 'src')
-rw-r--r--src/term.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/term.c b/src/term.c
index 94bf013f4a0..5cbb092ad17 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4168,6 +4168,15 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
4168 could return 32767. */ 4168 could return 32767. */
4169 tty->TN_max_colors = 16777216; 4169 tty->TN_max_colors = 16777216;
4170 } 4170 }
4171 /* Fall back to xterm+direct (semicolon version) if requested
4172 by the COLORTERM environment variable. */
4173 else if ((bg = getenv("COLORTERM")) != NULL
4174 && strcasecmp(bg, "truecolor") == 0)
4175 {
4176 tty->TS_set_foreground = "\033[%?%p1%{8}%<%t3%p1%d%e38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m";
4177 tty->TS_set_background = "\033[%?%p1%{8}%<%t4%p1%d%e48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m";
4178 tty->TN_max_colors = 16777216;
4179 }
4171 } 4180 }
4172#endif 4181#endif
4173 4182