Fix "home/~" PWD in eshell prompt

This commit is contained in:
Henrik Lissner 2018-06-28 19:29:26 +02:00
parent 40c8d7bd0e
commit 55104b9f89
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -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))