aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/misc/efaq.texi4
-rw-r--r--src/term.c9
2 files changed, 13 insertions, 0 deletions
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index f5f01848f77..8f7ed715b52 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -1595,6 +1595,10 @@ xterm-direct2 xterm with direct-color indexing (old)
1595xterm-direct xterm with direct-color indexing 1595xterm-direct xterm with direct-color indexing
1596@end example 1596@end example
1597 1597
1598If Terminfo database is not available, but 24-bit direct color mode is
1599supported, it can still be enabled by defining the environment
1600variable @env{COLORTERM} to @samp{truecolor}.
1601
1598Terminals with @samp{RGB} capability treat pixels #000001 - #000007 as 1602Terminals with @samp{RGB} capability treat pixels #000001 - #000007 as
1599indexed colors to maintain backward compatibility with applications 1603indexed colors to maintain backward compatibility with applications
1600that are unaware of direct color mode. Therefore the seven darkest 1604that are unaware of direct color mode. Therefore the seven darkest
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