about summary refs log tree commit diff stats
path: root/.emacs.d
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2024-08-30 15:49:08 +0100
committerDavid Morgan <djm_uk@protonmail.com>2024-08-30 15:49:08 +0100
commit3bfa4278d23c463361c5cad8879dc9a09c21d6d4 (patch)
tree1d4f9fac61e04003a8ad470818b161140dd0c2d0 /.emacs.d
parent020b89aac26034a8fe69b110e0c734b93587769e (diff)
downloaddotfiles-3bfa4278d23c463361c5cad8879dc9a09c21d6d4.tar.gz
Modify eshell prompt
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/lisp/init-shell.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/.emacs.d/lisp/init-shell.el b/.emacs.d/lisp/init-shell.el
index 4a03b27..8a64d4b 100644
--- a/.emacs.d/lisp/init-shell.el
+++ b/.emacs.d/lisp/init-shell.el
@@ -9,6 +9,21 @@
   (eshell-mode-hook . (lambda () (setenv "TERM" "xterm-256color")))
   :custom
   (eshell-directory-name (expand-file-name "eshell" save-dir))
+  (eshell-prompt-function
+   ;; Based on https://www.reddit.com/r/emacs/comments/6f0rkz/my_fancy_eshell_prompt/
+   (lambda ()
+     (concat
+      (propertize "┌─[" 'face `(:foreground "green"))
+      (propertize (user-login-name) 'face `(:foreground "red"))
+      (propertize "@" 'face `(:foreground "green"))
+      (propertize (system-name) 'face `(:foreground "LightBlue"))
+      (propertize "]──[" 'face `(:foreground "green"))
+      (propertize (format-time-string "%H:%M" (current-time)) 'face `(:foreground "yellow"))
+      (propertize "]──[" 'face `(:foreground "green"))
+      (propertize (concat (eshell/pwd)) 'face `(:foreground "white"))
+      (propertize "]\n" 'face `(:foreground "green"))
+      (propertize "└─>" 'face `(:foreground "green"))
+      (propertize (if (= (user-uid) 0) " # " " $ ") 'face `(:foreground "green")))))
   :config
   (setenv "PAGER" "cat"))