This package uses xterm-color to add customizable 256 color support to term
and ansi-term
.
Add eterm-256color-mode
to term-mode-hook
:
(add-hook 'term-mode-hook #'eterm-256color-mode)
Enjoy more colors.
- This package requires
eterm-color
. If it doesn’t exist on your system, you will be offered the option of fetching and compiling it from emacs-mirror. If instead you want to install manually, you can try:- linux
tic $(find /usr/share/emacs -name 'eterm-color.ti') # or tic -o ~/.terminfo $(find /usr/share/emacs -name 'eterm-color')
- macOS
tic $(find $(brew --prefix emacs)/ -name 'eterm-color.ti') # or tic -o ~/.terminfo $(find $(brew --prefix emacs-plus)/ -name 'eterm-color.ti') # or tic -o ~/.terminfo /Applications/Emacs.app/Contents/Resources/etc/e/eterm-color.ti
- linux
- You may have to restart ansi-term the very first time you start it after installing this package and adding the hook above - it should “just work” any time after that.
- Make sure
TERM
really gets set toeterm-256color
. It may be overridden if you exportTERM
in any of your shell init files.
This package is on melpa. If you have melpa in your package repositiories, you
can use M-x RET package-install RET eterm-256color
or install with
use-package:
(use-package eterm-256color
:ensure t)
Alternatively, consider installing with straight.el or quelpa-use-package.
Otherwise, download the files to somewhere in your load path, and require eterm-256color:
(require 'eterm-256color)
If installing manually, make sure the file eterm-256color.ti
is in the same
place as eterm-256color.el
.
You can use the variable eterm-256color-disable-bold
disable bold colors.
When specified as bold, colors 0 - 7 will be rendered with their “bright”
counterpart instead.
Each of the 256 faces is customizable:
Face | Alias | Default Value |
---|---|---|
eterm-256color-default | Inherited from default face | |
eterm-256color-black | eterm-256color-0 | Inherited from xterm-color-names |
eterm-256color-red | eterm-256color-1 | Inherited from xterm-color-names |
eterm-256color-green | eterm-256color-2 | Inherited from xterm-color-names |
eterm-256color-yellow | eterm-256color-3 | Inherited from xterm-color-names |
eterm-256color-blue | eterm-256color-4 | Inherited from xterm-color-names |
eterm-256color-magenta | eterm-256color-5 | Inherited from xterm-color-names |
eterm-256color-cyan | eterm-256color-6 | Inherited from xterm-color-names |
eterm-256color-white | eterm-256color-7 | Inherited from xterm-color-names |
eterm-256color-bright-black | eterm-256color-8 | Inherited from xterm-color-names-bright |
eterm-256color-bright-red | eterm-256color-9 | Inherited from xterm-color-names-bright |
eterm-256color-bright-green | eterm-256color-10 | Inherited from xterm-color-names-bright |
eterm-256color-bright-yellot | eterm-256color-11 | Inherited from xterm-color-names-bright |
eterm-256color-bright-blue | eterm-256color-12 | Inherited from xterm-color-names-bright |
eterm-256color-bright-magenta | eterm-256color-13 | Inherited from xterm-color-names-bright |
eterm-256color-bright-cyan | eterm-256color-14 | Inherited from xterm-color-names-bright |
eterm-256color-bright-white | eterm-256color-15 | Inherited from xterm-color-names-bright |
eterm-256color-16 - eterm-256color-255 | Generated by with xterm-color--256 |
Note that to customize the first 16 colors you can either customize the
variables xterm-color-names
and xterm-color-names-bright
or customize the
faces directly.