From eb0a008598d673ae86729c968f65c45146910ceb Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 12 Jan 2014 21:26:24 +0900 Subject: [PATCH] fix eshell prompt --- emacs.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/emacs.el b/emacs.el index 9c10576..2a697ca 100644 --- a/emacs.el +++ b/emacs.el @@ -1799,12 +1799,15 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (insert (abbreviate-file-name default-directory)) (setq p4 (point)) (insert "]") - (insert "\n:: " - (number-to-string eshell-last-command-status) - (if (= (user-uid) + (insert "\n:: ") + (unless (eq 0 + eshell-last-command-status) + (insert (format "[STATUS:%d] " + eshell-last-command-status))) + (insert (if (= (user-uid) 0) - " # " - " $ ")) + "# " + "$ ")) (add-text-properties p1 p2 '(face ((underline . t))))