diff options
| author | Rami Ylimäki | 2018-02-13 07:33:39 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2018-02-13 07:33:39 +0200 |
| commit | 4b70de228d663cdbbae9668e6e990b0064e72fda (patch) | |
| tree | dcc883dac22ff486c81b03066b51fb042c3e3b0a | |
| parent | 82c3be834786ff9afad4911cf3cc5aa0cd2c1b03 (diff) | |
| download | emacs-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.texi | 29 |
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 | ||
| 1491 | Syntax highlighting is on by default since version 22.1. | 1491 | Syntax highlighting is on by default since version 22.1. |
| 1492 | 1492 | ||
| 1493 | @cindex direct color in terminals | ||
| 1493 | Emacs 26.1 and later support direct color mode in terminals. If Emacs | 1494 | Emacs 26.1 and later support direct color mode in terminals. If Emacs |
| 1494 | finds Terminfo capabilities @samp{setb24} and @samp{setf24}, 24-bit | 1495 | finds Terminfo capabilities @samp{setb24} and @samp{setf24}, 24-bit |
| 1495 | direct color mode is used. The capability strings are expected to | 1496 | direct color mode is used. The capability strings are expected to |
| @@ -1504,14 +1505,17 @@ $ cat terminfo-custom.src | |||
| 1504 | 1505 | ||
| 1505 | xterm-emacs|xterm with 24-bit direct color mode for Emacs, | 1506 | xterm-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 | ||
| 1515 | Emacs 27.1 and later support Terminfo capability @samp{RGB} for | 1519 | Emacs 27.1 and later support Terminfo capability @samp{RGB} for |
| 1516 | detecting 24-bit direct color mode. Multiple standard terminal | 1520 | detecting 24-bit direct color mode. Multiple standard terminal |
| 1517 | definitions support this capability. | 1521 | definitions 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 | ||
| 1534 | If your terminal is incompatible with XTerm, you may have to use | ||
| 1535 | another @env{TERM} definition. Any terminal whose name includes | ||
| 1536 | @samp{direct} should be a candidate. The @command{toe} command can be | ||
| 1537 | used to find out which of these are installed on your system: | ||
| 1538 | |||
| 1539 | @example | ||
| 1540 | $ toe | grep '\-direct' | ||
| 1541 | |||
| 1542 | konsole-direct konsole with direct-color indexing | ||
| 1543 | vte-direct vte with direct-color indexing | ||
| 1544 | st-direct st with direct-color indexing | ||
| 1545 | xterm-direct2 xterm with direct-color indexing (old) | ||
| 1546 | xterm-direct xterm with direct-color indexing | ||
| 1547 | @end example | ||
| 1548 | |||
| 1528 | Terminals with @samp{RGB} capability treat pixels #000001 - #000007 as | 1549 | Terminals with @samp{RGB} capability treat pixels #000001 - #000007 as |
| 1529 | indexed colors to maintain backward compatibility with applications | 1550 | indexed colors to maintain backward compatibility with applications |
| 1530 | that are unaware of direct color mode. Therefore the seven darkest | 1551 | that are unaware of direct color mode. Therefore the seven darkest |