aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRami Ylimäki2018-02-13 07:33:39 +0200
committerEli Zaretskii2018-02-13 07:33:39 +0200
commit4b70de228d663cdbbae9668e6e990b0064e72fda (patch)
treedcc883dac22ff486c81b03066b51fb042c3e3b0a
parent82c3be834786ff9afad4911cf3cc5aa0cd2c1b03 (diff)
downloademacs-4b70de228d663cdbbae9668e6e990b0064e72fda.tar.gz
emacs-4b70de228d663cdbbae9668e6e990b0064e72fda.zip
Expand direct color description in Emacs FAQ
* doc/misc/efaq.texi (Colors on a TTY): Show how to list direct mode TERM definitions. (Bug#30429)
-rw-r--r--doc/misc/efaq.texi29
1 files changed, 25 insertions, 4 deletions
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index fef9b1051b0..5392748d00f 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -1490,6 +1490,7 @@ exhibits all the colors Emacs knows about on the current display.
1490 1490
1491Syntax highlighting is on by default since version 22.1. 1491Syntax highlighting is on by default since version 22.1.
1492 1492
1493@cindex direct color in terminals
1493Emacs 26.1 and later support direct color mode in terminals. If Emacs 1494Emacs 26.1 and later support direct color mode in terminals. If Emacs
1494finds Terminfo capabilities @samp{setb24} and @samp{setf24}, 24-bit 1495finds Terminfo capabilities @samp{setb24} and @samp{setf24}, 24-bit
1495direct color mode is used. The capability strings are expected to 1496direct color mode is used. The capability strings are expected to
@@ -1504,14 +1505,17 @@ $ cat terminfo-custom.src
1504 1505
1505xterm-emacs|xterm with 24-bit direct color mode for Emacs, 1506xterm-emacs|xterm with 24-bit direct color mode for Emacs,
1506 use=xterm-256color, 1507 use=xterm-256color,
1507 setb24=\E[48\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%dm, 1508 setb24=\E[48\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&\
1508 setf24=\E[38\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%dm, 1509 %d\:%p1%@{255@}%&%dm,
1510 setf24=\E[38\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&\
1511 %d\:%p1%@{255@}%&%dm,
1509 1512
1510$ tic -x -o ~/.terminfo terminfo-custom.src 1513$ tic -x -o ~/.terminfo terminfo-custom.src
1511 1514
1512$ TERM=xterm-emacs emacs -nw 1515$ TERM=xterm-emacs emacs -nw
1513@end example 1516@end example
1514 1517
1518@cindex 24-bit direct color mode
1515Emacs 27.1 and later support Terminfo capability @samp{RGB} for 1519Emacs 27.1 and later support Terminfo capability @samp{RGB} for
1516detecting 24-bit direct color mode. Multiple standard terminal 1520detecting 24-bit direct color mode. Multiple standard terminal
1517definitions support this capability. 1521definitions support this capability.
@@ -1519,12 +1523,29 @@ definitions support this capability.
1519@example 1523@example
1520$ TERM=xterm-direct infocmp | grep seta[bf] 1524$ TERM=xterm-direct infocmp | grep seta[bf]
1521 1525
1522 setab=\E[%?%p1%@{8@}%<%t4%p1%d%e48\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%d%;m, 1526 setab=\E[%?%p1%@{8@}%<%t4%p1%d%e48\:2\:\:%p1%@{65536@}%/\
1523 setaf=\E[%?%p1%@{8@}%<%t3%p1%d%e38\:2\:\:%p1%@{65536@}%/%d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%d%;m, 1527 %d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%d%;m,
1528 setaf=\E[%?%p1%@{8@}%<%t3%p1%d%e38\:2\:\:%p1%@{65536@}%/\
1529 %d\:%p1%@{256@}%/%@{255@}%&%d\:%p1%@{255@}%&%d%;m,
1524 1530
1525$ TERM=xterm-direct emacs -nw 1531$ TERM=xterm-direct emacs -nw
1526@end example 1532@end example
1527 1533
1534If your terminal is incompatible with XTerm, you may have to use
1535another @env{TERM} definition. Any terminal whose name includes
1536@samp{direct} should be a candidate. The @command{toe} command can be
1537used to find out which of these are installed on your system:
1538
1539@example
1540$ toe | grep '\-direct'
1541
1542konsole-direct konsole with direct-color indexing
1543vte-direct vte with direct-color indexing
1544st-direct st with direct-color indexing
1545xterm-direct2 xterm with direct-color indexing (old)
1546xterm-direct xterm with direct-color indexing
1547@end example
1548
1528Terminals with @samp{RGB} capability treat pixels #000001 - #000007 as 1549Terminals with @samp{RGB} capability treat pixels #000001 - #000007 as
1529indexed colors to maintain backward compatibility with applications 1550indexed colors to maintain backward compatibility with applications
1530that are unaware of direct color mode. Therefore the seven darkest 1551that are unaware of direct color mode. Therefore the seven darkest