summaryrefslogtreecommitdiffstats
path: root/.emacs.d
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2024-02-24 13:03:04 -0500
committerAmin Bandali <bandali@gnu.org>2024-02-24 13:03:04 -0500
commit46d6e13705912697af373db1259fc7c773742ec2 (patch)
treea340440ae8446498a007c041f99d48cade1fca44 /.emacs.d
parent40a9b1c8f2ea9b1a1276fe0c25b3a5270d534bd0 (diff)
downloadconfigs-46d6e13705912697af373db1259fc7c773742ec2.tar.gz
configs-46d6e13705912697af373db1259fc7c773742ec2.tar.xz
configs-46d6e13705912697af373db1259fc7c773742ec2.zip
Adapt eshell prompt to match my bash prompt
Diffstat (limited to '')
-rw-r--r--.emacs.d/lisp/bandali-eshell.el33
1 files changed, 22 insertions, 11 deletions
diff --git a/.emacs.d/lisp/bandali-eshell.el b/.emacs.d/lisp/bandali-eshell.el
index 66e7808..7bf3b4f 100644
--- a/.emacs.d/lisp/bandali-eshell.el
+++ b/.emacs.d/lisp/bandali-eshell.el
@@ -31,19 +31,30 @@
eshell-directory-name (b/var "eshell/")
eshell-hist-ignoredups t
eshell-input-filter #'eshell-input-filter-initial-space
- eshell-prompt-regexp "\\(.*\n\\)*[$#] "
+ ;; eshell-prompt-regexp "\\(.*\n\\)*[$#] "
+ ;; eshell-prompt-function
+ ;; (lambda ()
+ ;; (concat
+ ;; (propertize (format "%s@%s:" (user-login-name) (system-name))
+ ;; '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)))
+ eshell-prompt-regexp "^[^#$\n]* [#$] ; "
eshell-prompt-function
(lambda ()
- (concat
- (propertize (format "%s@%s:" (user-login-name) (system-name))
- '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))))
+ (concat ": "
+ (system-name)
+ ":"
+ (abbreviate-file-name (eshell/pwd))
+ (unless (eshell-exit-success-p)
+ (format " [%d]" eshell-last-command-status))
+ (if (= (file-user-uid) 0) " # " " $ ")
+ "; ")))
(eval-when-compile
(defvar eshell-prompt-regexp)
(declare-function eshell-life-is-too-much "esh-mode")