From f7a4b639e76cbd54f41bd9fe3b5506459d9adddd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 28 Jun 2018 14:25:03 +0200 Subject: [PATCH] Fix read-only errors when reopening eshell buffers Caused because eshell would try to insert the banner into the eshell prompt. --- modules/emacs/eshell/autoload/eshell.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/emacs/eshell/autoload/eshell.el b/modules/emacs/eshell/autoload/eshell.el index b0ac1c5c0..def80ad7b 100644 --- a/modules/emacs/eshell/autoload/eshell.el +++ b/modules/emacs/eshell/autoload/eshell.el @@ -85,7 +85,9 @@ (let* ((default-directory (if arg default-directory (doom-project-root))) (buf (+eshell--unused-buffer))) (with-current-buffer (switch-to-buffer buf) - (eshell-mode) + (if (eq major-mode 'eshell-mode) + (run-hooks 'eshell-mode-hook) + (eshell-mode)) (if command (+eshell-run-command command buf))) buf)) @@ -96,7 +98,9 @@ (let* ((default-directory (if arg default-directory (doom-project-root))) (buf (+eshell--unused-buffer))) (with-current-buffer (pop-to-buffer buf) - (eshell-mode) + (if (eq major-mode 'eshell-mode) + (run-hooks 'eshell-mode-hook) + (eshell-mode)) (if command (+eshell-run-command command buf))) buf))