aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorRami Ylimäki2017-02-18 13:04:55 +0200
committerEli Zaretskii2017-02-18 13:04:55 +0200
commite463e5762bbe628be3d15da066a90f079a8468b3 (patch)
tree2aa517f3626acbe0dbc73dc7ad5a8ec7d81656c9 /doc/misc
parent464a51ed46990554bed8a9443168c976d6c3c6d3 (diff)
downloademacs-e463e5762bbe628be3d15da066a90f079a8468b3.tar.gz
emacs-e463e5762bbe628be3d15da066a90f079a8468b3.zip
Support 24-bit direct colors on text terminals
* src/term.c (init_tty): Use 24-bit terminal colors if corresponding foreground and background functions are present in terminal type definition. * src/tparam.h: Define prototype for tigetstr. * lisp/term/tty-colors.el (tty-color-define): Convert color palette index to pixel value on 16.7M color terminals. (tty-color-24bit): New function to convert color palette index to pixel value on 16.7M color terminals. (tty-color-desc): Don't approximate colors on 16.7M color terminals. * lisp/term/xterm.el (xterm-register-default-colors): Define all named TTY colors on 16.7M color terminals. * doc/misc/efaq.texi (Colors on a TTY): Add instructions on how to enable direct color TTY mode. * etc/NEWS: Mention direct color TTY mode and point to FAQ.
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/efaq.texi33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index f7a47f8675a..e9cfe7afce9 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -1491,6 +1491,39 @@ exhibits all the colors Emacs knows about on the current display.
1491 1491
1492Syntax highlighting is on by default since version 22.1. 1492Syntax highlighting is on by default since version 22.1.
1493 1493
1494Emacs 26.1 and later support direct color mode in terminals. If Emacs
1495finds Terminfo capabilities @samp{setb24} and @samp{setf24}, 24-bit
1496direct color mode is used. The capability strings are expected to
1497take one 24-bit pixel value as argument and transform the pixel to a
1498string that can be used to send 24-bit colors to the terminal.
1499
1500There aren't yet any standard terminal type definitions that would
1501support the capabilities, but Emacs can be invoked with a custom
1502definition as shown below.
1503
1504@example
1505$ cat terminfo-24bit.src
1506
1507# Use colon separators.
1508xterm-24bit|xterm with 24-bit direct color mode,
1509 use=xterm-256color,
1510 setb24=\E[48:2:%p1%@{65536@}%/%d:%p1%@{256@}%/%@{255@}%&%d:%p1%@{255@}%&%dm,
1511 setf24=\E[38:2:%p1%@{65536@}%/%d:%p1%@{256@}%/%@{255@}%&%d:%p1%@{255@}%&%dm,
1512# Use semicolon separators.
1513xterm-24bits|xterm with 24-bit direct color mode,
1514 use=xterm-256color,
1515 setb24=\E[48;2;%p1%@{65536@}%/%d;%p1%@{256@}%/%@{255@}%&%d;%p1%@{255@}%&%dm,
1516 setf24=\E[38;2;%p1%@{65536@}%/%d;%p1%@{256@}%/%@{255@}%&%d;%p1%@{255@}%&%dm,
1517
1518$ tic -x -o ~/.terminfo terminfo-24bit.src
1519
1520$ TERM=xterm-24bit emacs -nw
1521@end example
1522
1523Currently there's no standard way to determine whether a terminal
1524supports direct color mode. If such standard arises later on, support
1525for @samp{setb24} and @samp{setf24} may be removed.
1526
1494@node Debugging a customization file 1527@node Debugging a customization file
1495@section How do I debug a @file{.emacs} file? 1528@section How do I debug a @file{.emacs} file?
1496@cindex Debugging @file{.emacs} file 1529@cindex Debugging @file{.emacs} file