eterm-256color icon indicating copy to clipboard operation
eterm-256color copied to clipboard

Customizable 256 colors for emacs term and ansi-term

  • eterm-256color [[https://melpa.org/#/eterm-256color][file:https://melpa.org/packages/eterm-256color-badge.svg]] [[https://stable.melpa.org/#/eterm-256color][file:https://stable.melpa.org/packages/eterm-256color-badge.svg]]

This package uses [[https://github.com/atomontage/xterm-color][xterm-color]] to add customizable 256 color support to ~term~ and ~ansi-term~.

** Usage Add ~eterm-256color-mode~ to ~term-mode-hook~: #+begin_src emacs-lisp (add-hook 'term-mode-hook #'eterm-256color-mode) #+end_src Enjoy more colors.

*** Notes

  • 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 [[https://github.com/emacs-mirror/emacs][emacs-mirror]]. If instead you want to install manually, you can try:
    • linux #+begin_src sh tic $(find /usr/share/emacs -name 'eterm-color.ti')

      or

      tic -o ~/.terminfo $(find /usr/share/emacs -name 'eterm-color') #+end_src
    • macOS #+BEGIN_SRC sh 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 #+END_SRC
  • 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 to ~eterm-256color~. It may be overridden if you export ~TERM~ in any of your shell init files.

** Installation 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 [[https://github.com/jwiegley/use-package][use-package]]: #+begin_src emacs-lisp (use-package eterm-256color :ensure t) #+end_src

Alternatively, consider installing with [[https://github.com/raxod502/straight.el][straight.el]] or [[https://github.com/quelpa/quelpa-use-package][quelpa-use-package]].

Otherwise, download the files to somewhere in your load path, and require eterm-256color: #+begin_src emacs-lisp (require 'eterm-256color) #+end_src

If installing manually, make sure the file ~eterm-256color.ti~ is in the same place as ~eterm-256color.el~.

** Customization *** Bold 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. *** Faces 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.