Skip to content

dieggsy/eterm-256color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 

Repository files navigation

eterm-256color

https://melpa.org/packages/eterm-256color-badge.svg https://stable.melpa.org/packages/eterm-256color-badge.svg

This package uses xterm-color to add customizable 256 color support to term and ansi-term.

Usage

Add eterm-256color-mode to term-mode-hook:

(add-hook 'term-mode-hook #'eterm-256color-mode)

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 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
              
  • 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 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.

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:

FaceAliasDefault Value
eterm-256color-defaultInherited from default face
eterm-256color-blacketerm-256color-0Inherited from xterm-color-names
eterm-256color-redeterm-256color-1Inherited from xterm-color-names
eterm-256color-greeneterm-256color-2Inherited from xterm-color-names
eterm-256color-yelloweterm-256color-3Inherited from xterm-color-names
eterm-256color-blueeterm-256color-4Inherited from xterm-color-names
eterm-256color-magentaeterm-256color-5Inherited from xterm-color-names
eterm-256color-cyaneterm-256color-6Inherited from xterm-color-names
eterm-256color-whiteeterm-256color-7Inherited from xterm-color-names
eterm-256color-bright-blacketerm-256color-8Inherited from xterm-color-names-bright
eterm-256color-bright-redeterm-256color-9Inherited from xterm-color-names-bright
eterm-256color-bright-greeneterm-256color-10Inherited from xterm-color-names-bright
eterm-256color-bright-yelloteterm-256color-11Inherited from xterm-color-names-bright
eterm-256color-bright-blueeterm-256color-12Inherited from xterm-color-names-bright
eterm-256color-bright-magentaeterm-256color-13Inherited from xterm-color-names-bright
eterm-256color-bright-cyaneterm-256color-14Inherited from xterm-color-names-bright
eterm-256color-bright-whiteeterm-256color-15Inherited from xterm-color-names-bright
eterm-256color-16 - eterm-256color-255Generated 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.