Preserve current directory when splitting eshell

Fixes #3091
This commit is contained in:
Henrik Lissner 2020-05-11 22:09:17 -04:00
parent 24aabfc8e0
commit de27b2c041
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -21,13 +21,15 @@
t)) t))
(defun +eshell--bury-buffer (&optional dedicated-p) (defun +eshell--bury-buffer (&optional dedicated-p)
(unless (switch-to-prev-buffer nil 'bury) (let ((directory default-directory))
(switch-to-buffer (doom-fallback-buffer))) (unless (switch-to-prev-buffer nil 'bury)
(when (eq major-mode 'eshell-mode) (switch-to-buffer (doom-fallback-buffer)))
(switch-to-buffer (doom-fallback-buffer))) (when (eq major-mode 'eshell-mode)
(when +eshell-enable-new-shell-on-split (switch-to-buffer (doom-fallback-buffer)))
(when-let (win (get-buffer-window (+eshell/here))) (when +eshell-enable-new-shell-on-split
(set-window-dedicated-p win dedicated-p)))) (let ((default-directory directory))
(when-let (win (get-buffer-window (+eshell/here t)))
(set-window-dedicated-p win dedicated-p))))))
(defun +eshell--setup-window (window &optional flag) (defun +eshell--setup-window (window &optional flag)
(when (window-live-p window) (when (window-live-p window)