summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2019-09-22 20:47:35 -0400
committerAmin Bandali <bandali@gnu.org>2019-09-22 20:47:35 -0400
commit92bbb7aab082f4a6c2aacfcb3995c21466a95835 (patch)
tree8621f3d89095dc0d0cf08e274b65d1b516584c11
parentfc3402997ba7c66fd8aa09fcf0c0b4225c6b7432 (diff)
downloadconfigs-92bbb7aab082f4a6c2aacfcb3995c21466a95835.tar.gz
configs-92bbb7aab082f4a6c2aacfcb3995c21466a95835.tar.xz
configs-92bbb7aab082f4a6c2aacfcb3995c21466a95835.zip
emacs: update eshell prompt to match new bash prompt
-rw-r--r--.emacs.d/init.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 1f31d3b..422930e 100644
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -1750,16 +1750,17 @@ This function is intended for use with `ivy-ignore-buffers'."
:defer 0.5
:after eshell
:config
- (defvar user-@-host (concat (user-login-name) "@" (system-name) " "))
+ (defvar user-@-host (concat (user-login-name) "@" (system-name) ":"))
(defun +eshell/prompt ()
- (let ((base/dir (shrink-path-prompt default-directory)))
- (concat (propertize user-@-host 'face 'default)
- (propertize (car base/dir)
- 'face 'font-lock-comment-face)
- (propertize (cdr base/dir)
- 'face 'font-lock-constant-face)
- (propertize "> " 'face 'default))))
- (setq eshell-prompt-regexp (concat user-@-host ".*> ")
+ (concat (propertize user-@-host 'face 'default)
+ (propertize (abbreviate-file-name default-directory)
+ 'face 'font-lock-comment-face)
+ (propertize "\n" 'face 'default)
+ (if (= (user-uid) 0)
+ (propertize "#" 'face 'red)
+ (propertize "$" 'face 'default))
+ (propertize " " 'face 'default)))
+ (setq eshell-prompt-regexp "\\(.*\n\\)*[$#] "
eshell-prompt-function #'+eshell/prompt))
(use-package eshell-up