Fix eshell banner when directory is not a git project
This commit is contained in:
parent
e5891170a0
commit
105a97250c
1 changed files with 12 additions and 12 deletions
|
@ -1502,8 +1502,7 @@ Whenever I open a shell, I instinctively type =ls= … so why not do that automa
|
|||
(let ((fg (face-attribute 'default :background))
|
||||
(bg (face-attribute 'default :foreground))
|
||||
(bg "#c09644")
|
||||
(dd (thread-last default-directory
|
||||
(replace-regexp-in-string (getenv "HOME") "~")))
|
||||
(dd (replace-regexp-in-string (getenv "HOME") "~" default-directory))
|
||||
(gs (or (ha-eshell-banner-git-branch) "")))
|
||||
(condition-case err
|
||||
(concat
|
||||
|
@ -1519,6 +1518,7 @@ Whenever I open a shell, I instinctively type =ls= … so why not do that automa
|
|||
|
||||
(defun ha-eshell-banner-git-branch ()
|
||||
"Return simplified Git branch for current directory."
|
||||
(ignore-errors
|
||||
(thread-last "git status --short --branch --ahead-behind 2>/dev/null"
|
||||
(shell-command-to-list)
|
||||
(first)
|
||||
|
@ -1528,7 +1528,7 @@ Whenever I open a shell, I instinctively type =ls= … so why not do that automa
|
|||
(zero-or-more anychar))
|
||||
"\\1")
|
||||
(replace-regexp-in-string
|
||||
(rx "...") " → ")))
|
||||
(rx "...") " → "))))
|
||||
#+end_src
|
||||
* Shell Windows
|
||||
Now that I often need to pop into remote systems to run a shell or commands, I create helper functions to create those buffer windows. Each buffer begins with =eshell=: allowing me to have more than one eshells, typically, one per project.
|
||||
|
|
Loading…
Reference in a new issue