[emacs-berlin] Colors in Eshell

Felix E. Klee felix.klee at inka.de
Thu Aug 1 09:05:02 UTC 2019


To follow up on yesterday’s meetup experiments, just installing
`xterm-color` from MELPA isn’t sufficient.  It also needs to be
[configured][1]:

    (require 'eshell)
    (add-hook 'eshell-before-prompt-hook
              (lambda ()
                (setq xterm-color-preserve-properties t)))
    (add-to-list 'eshell-preoutput-filter-functions 'xterm-color-filter)
    (setq eshell-output-filter-functions
          (remove
           'eshell-handle-ansi-color eshell-output-filter-functions))

Now the weather is colorful: 🌞

    $ curl wttr.in/berlin

Or, with [white background][2]:

    $ curl wttr.in/berlin?I

[1]: https://github.com/atomontage/xterm-color#usage
[2]: https://github.com/chubin/wttr.in/issues/200


More information about the emacs-berlin mailing list