Added
Link Here
|
1 |
Add RGB fallback if environment has COLORTERM=truecolor |
2 |
https://github.com/emacs-mirror/emacs/commit/50f489b5dc59 |
3 |
|
4 |
--- doc/misc/efaq.texi.orig 2019-01-07 14:26:06 UTC |
5 |
+++ doc/misc/efaq.texi |
6 |
@@ -1603,6 +1603,10 @@ Currently there's no standard way to determine whether |
7 |
supports direct color mode. If such standard arises later on, support |
8 |
for @samp{setb24} and @samp{setf24} may be removed. |
9 |
|
10 |
+If Terminfo database is not available, but 24-bit direct color mode is |
11 |
+supported, it can still be enabled by defining the environment |
12 |
+variable @env{COLORTERM} to @samp{truecolor}. |
13 |
+ |
14 |
@node Debugging a customization file |
15 |
@section How do I debug a @file{.emacs} file? |
16 |
@cindex Debugging @file{.emacs} file |
17 |
--- src/term.c.orig 2019-01-07 14:26:07 UTC |
18 |
+++ src/term.c |
19 |
@@ -4157,6 +4157,15 @@ use the Bourne shell command 'TERM=...; export TERM' ( |
20 |
tty->TS_set_background = bg; |
21 |
tty->TN_max_colors = 16777216; |
22 |
} |
23 |
+ /* Fall back to xterm+direct (semicolon version) if requested |
24 |
+ by the COLORTERM environment variable. */ |
25 |
+ else if ((bg = getenv("COLORTERM")) != NULL |
26 |
+ && strcasecmp(bg, "truecolor") == 0) |
27 |
+ { |
28 |
+ tty->TS_set_foreground = "\033[%?%p1%{8}%<%t3%p1%d%e38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m"; |
29 |
+ tty->TS_set_background = "\033[%?%p1%{8}%<%t4%p1%d%e48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m"; |
30 |
+ tty->TN_max_colors = 16777216; |
31 |
+ } |
32 |
} |
33 |
#endif |
34 |
|