Skip to content

Instantly share code, notes, and snippets.

@Pitometsu
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pitometsu/23e29d33c3a0a8a15e1b to your computer and use it in GitHub Desktop.
Save Pitometsu/23e29d33c3a0a8a15e1b to your computer and use it in GitHub Desktop.
;; eshell prompt
(setq eshell-prompt-function
(lambda ()
(let ((user-uid-face (if (zerop (user-uid))
'((t (:inherit (eshell-ls-missing eshell-prompt bold))))
'((t (:inherit (eshell-ls-directory eshell-prompt bold)))))))
(concat
(propertize (or (ignore-errors
(format "[%s] "
(vc-call-backend (vc-responsible-backend default-directory) 'mode-line-string default-directory)
;; (symbol-name (vc-responsible-backend default-directory))
)) "")
'face '((t (:inherit (eshell-ls-clutter eshell-prompt)))))
(propertize (eshell/pwd)
'face '((t (:inherit (eshell-prompt)))))
(propertize (format-time-string " | %Y-%m-%d %H:%M " (current-time))
'face '((t (:inherit (org-hide eshell-prompt)))))
(propertize "\n"
'face '((t (:inherit eshell-prompt))))
(propertize user-login-name
'face '((t (:inherit (eshell-ls-symlink eshell-prompt)))))
(propertize "@"
'face user-uid-face)
(propertize system-name
'face '((t (:inherit (eshell-ls-executable eshell-prompt)))))
(if (= (user-uid) 0)
(propertize " ■"
'face user-uid-face)
(propertize " ●"
'face user-uid-face))
" "))))
(setq eshell-prompt-regexp "^[^■●\n]* [■●] ")
;; problem here:
(setq eshell-highlight-prompt nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment