summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorMiha Rihtaršič <miha@kamnitnik.top>2021-09-25 23:28:08 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-10-05 08:54:00 +0200
commit76895fcd0b667eadd78bfe6cf51619f8b00e157f (patch)
tree976c8dabaa3c5a4dc23451e534c26cdb15f8628f /etc
parent0fa2279b90bf5a638d8377032b71135e1374e8fb (diff)
downloademacs-76895fcd0b667eadd78bfe6cf51619f8b00e157f.tar.gz
emacs-76895fcd0b667eadd78bfe6cf51619f8b00e157f.tar.bz2
emacs-76895fcd0b667eadd78bfe6cf51619f8b00e157f.zip
Add support for 256-color and 24bit ANSI colors in term-mode
(term-ansi-face-already-done): Make obsolete (term--maybe-brighten-color): Remove (term--color-as-hex): New function (term-handle-colors-array): Make obsolete in favour of the new function 'term--handle-colors-list'. (term--handle-colors-list): New function, that can also handle ANSI codes 38 and 48. (term-handle-ansi-escape): Use it * test/lisp/term-tests.el (ansi-test-strings): Add tests for 256-color and 24bit ANSI colors
Diffstat (limited to 'etc')
-rw-r--r--etc/NEWS7
-rw-r--r--etc/e/README18
-rw-r--r--etc/e/eterm-colorbin1179 -> 1275 bytes
-rw-r--r--etc/e/eterm-color.ti15
-rw-r--r--etc/e/eterm-directbin0 -> 1354 bytes
5 files changed, 27 insertions, 13 deletions
diff --git a/etc/NEWS b/etc/NEWS
index c2dde4ea331..3c16e2fd4d4 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -89,6 +89,13 @@ mode (instead of at load time).
256-color and 24-bit color codes are now handled by ANSI color
filters and displayed with the specified color.
+** term-mode
+
+---
+*** Support for ANSI 256-color and 24-bit colors.
+256-color and 24-bit color codes are now displayed with the specified
+color.
+
* New Modes and Packages in Emacs 29.1
diff --git a/etc/e/README b/etc/e/README
index dd2c8d64e25..1293292a878 100644
--- a/etc/e/README
+++ b/etc/e/README
@@ -1,12 +1,12 @@
-eterm-color.ti is a terminfo source file. eterm-color is a compiled
-version produced by the terminfo compiler (tic). The compiled files
-are binary, and depend on the version of tic, but they seem to be
-system-independent and backwardly compatible. So there should be no
-need to recompile the distributed binary version. If it is
-necessary, use:
+eterm-color.ti is a terminfo source file. eterm-color and
+eterm-direct are compiled versions produced by the terminfo compiler
+(tic). The compiled files are binary, and depend on the version of
+tic, but they seem to be system-independent and backwardly compatible.
+So there should be no need to recompile the distributed binary
+version. If it is necessary, use:
tic -o ../ ./eterm-color.ti
-The compiled file is used by lisp/term.el, so if it is moved term.el
-needs to be changed. terminfo requires it to be stored in an 'e'
-subdirectory (the first character of the file name).
+The compiled files are used by lisp/term.el, so if they are moved,
+term.el needs to be changed. terminfo requires them to be stored in
+an 'e' subdirectory (the first character of the file name).
diff --git a/etc/e/eterm-color b/etc/e/eterm-color
index bd3f5003ae6..99603ba5613 100644
--- a/etc/e/eterm-color
+++ b/etc/e/eterm-color
Binary files differ
diff --git a/etc/e/eterm-color.ti b/etc/e/eterm-color.ti
index a6ef8149900..61c29e6dcc8 100644
--- a/etc/e/eterm-color.ti
+++ b/etc/e/eterm-color.ti
@@ -9,10 +9,10 @@ eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96,
# Any change to this file should be done at the same time with a
# corresponding change to the TERMCAP environment variable in term.el.
# Comments in term.el specify where each of these capabilities is implemented.
- colors#8,
+ colors#256,
cols#80,
lines#24,
- pairs#64,
+ pairs#32767,
am,
mir,
msgr,
@@ -65,8 +65,8 @@ eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96,
rmul=\E[24m,
rs1=\Ec,
sc=\E7,
- setab=\E[%p1%{40}%+%dm,
- setaf=\E[%p1%{30}%+%dm,
+ setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
+ setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
sgr0=\E[m,
smir=\E[4h,
smul=\E[4m,
@@ -76,3 +76,10 @@ eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96,
# smcup=\E[?47h,
# rmcup=\E[?47l,
# rs2 may need to be added
+
+eterm-direct|Emacs term.el with direct-color indexing term-protocol-version 0.96,
+ use=eterm-color,
+ colors#0x1000000,
+ pairs#0x10000,
+ setab=\E[%?%p1%{8}%<%t4%p1%d%e48;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m,
+ setaf=\E[%?%p1%{8}%<%t3%p1%d%e38;2;%p1%{65536}%/%d;%p1%{256}%/%{255}%&%d;%p1%{255}%&%d%;m,
diff --git a/etc/e/eterm-direct b/etc/e/eterm-direct
new file mode 100644
index 00000000000..35983ec8ade
--- /dev/null
+++ b/etc/e/eterm-direct
Binary files differ