UP | HOME

Eshell Smiley Prompt

Display a blue :) if the previous command succeeded, and a red :( if it fails.

(defun my-eshell-prompt-function ()
  (concat (abbreviate-file-name (eshell/pwd)) " "
          (if (> eshell-last-command-status 0)
              (propertize ":(" 'face '(:foreground "red"))
            (propertize ":)" 'face '(:foreground "light blue")))
          " $ "))

(setq eshell-prompt-function 'my-eshell-prompt-function)
(setq eshell-prompt-regex "^[^#$]*[#$] ")

Here's what it looks like in action (with solarized theme):

eshell-smiley-prompt-screenshot.png