From 55104b9f89b13c0d862bad147c96a64d96a92cd5 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 28 Jun 2018 19:29:26 +0200 Subject: [PATCH] Fix "home/~" PWD in eshell prompt --- modules/emacs/eshell/autoload/prompts.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/emacs/eshell/autoload/prompts.el b/modules/emacs/eshell/autoload/prompts.el index 8509486ed..1507350ac 100644 --- a/modules/emacs/eshell/autoload/prompts.el +++ b/modules/emacs/eshell/autoload/prompts.el @@ -23,8 +23,11 @@ (defun +eshell-default-prompt () "Generate the prompt string for eshell. Use for `eshell-prompt-function'." (concat (if (bobp) "" "\n") - (propertize (abbreviate-file-name (shrink-path-file (eshell/pwd))) - 'face '+eshell-prompt-pwd) + (let ((pwd (eshell/pwd))) + (propertize (if (equal pwd "~") + pwd + (abbreviate-file-name (shrink-path-file pwd))) + 'face '+eshell-prompt-pwd)) (propertize (+eshell--current-git-branch) 'face '+eshell-prompt-git-branch) (propertize " λ" 'face (if (zerop eshell-last-command-status) 'success 'error))