From 3800f65c7ae33e5745ee709bb28924894677e8a7 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Wed, 1 Nov 2017 18:22:05 +0100 Subject: [PATCH] Eshell: Fix prompt when no branch and use comment face for status --- .emacs.d/lisp/init-eshell.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.emacs.d/lisp/init-eshell.el b/.emacs.d/lisp/init-eshell.el index eb1a5628..851e23a5 100644 --- a/.emacs.d/lisp/init-eshell.el +++ b/.emacs.d/lisp/init-eshell.el @@ -85,19 +85,19 @@ (let ((path (abbreviate-file-name (eshell/pwd)))) (concat (when eshell-status-p - (or (eshell-status-display) "")) + (or (propertize (eshell-status-display) 'face font-lock-comment-face) "")) (format (propertize "(%s@%s)" 'face '(:weight bold)) (propertize (user-login-name) 'face '(:foreground "cyan")) (propertize (system-name) 'face '(:foreground "cyan"))) - (if (and (require 'magit nil t) (magit-get-current-branch)) + (if (and (require 'magit nil t) (or (magit-get-current-branch) (magit-get-current-tag))) (let* ((root (abbreviate-file-name (magit-rev-parse "--show-toplevel"))) (after-root (substring-no-properties path (min (length path) (1+ (length root)))))) (format (propertize "[%s/%s@%s]" 'face '(:weight bold)) (propertize root 'face `(:foreground ,(if (= (user-uid) 0) "orange" "gold"))) (propertize after-root 'face `(:foreground ,(if (= (user-uid) 0) "red" "green") :weight bold)) - (magit-get-current-branch))) + (or (magit-get-current-branch) (magit-get-current-tag)))) (format (propertize "[%s]" 'face '(:weight bold)) (propertize path 'face `(:foreground ,(if (= (user-uid) 0) "red" "green") :weight bold))))