From c174080d4ab1cbacd6a5a1290cecc20b171bf1ea Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 27 Aug 2022 16:38:55 +0200 Subject: [PATCH] Restyle git branch information in eshell prompt Just an idea. --- site-lisp/db-eshell.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site-lisp/db-eshell.el b/site-lisp/db-eshell.el index 38c98ad..1d018ce 100644 --- a/site-lisp/db-eshell.el +++ b/site-lisp/db-eshell.el @@ -74,12 +74,12 @@ git repository." (let* ((git-branch (string-trim (shell-command-to-string "git rev-parse --abbrev-ref HEAD"))) (base-dir (file-name-base (string-trim-right repo-dir "/?")))) - (format "%s::%s" base-dir git-branch)))))) + (format "%s@%s" git-branch base-dir)))))) (defun eshell/default-prompt-function () "A prompt for eshell of the form - ┌─[$USER@$HOST] [$PWD] (current-git-branch) + ┌─$USER@$HOST $PWD (current-git-branch) └─ Information about the current git branch will be empty when the @@ -95,7 +95,7 @@ formatting." (propertize (abbreviate-file-name (eshell/pwd)) 'face '(:foreground "#dc322f")) (when-let ((git-branch (db/eshell-git-branch-string))) - (format " (%s)" git-branch)) + (format " (git:%s)" git-branch)) "\n" (propertize "└─" 'face head-face) (if (zerop (user-uid)) "#" "$")