mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix(eshell,shell): display buffer post-init
By displaying them pre-init: a) eshell will not have loaded, ensuring any user-popup rules in an (after! eshell ...) block don't load in time for the first eshell popup, b) Popup predicate functions don't have access to the full state of the buffer, if needed.
This commit is contained in:
@ -102,13 +102,14 @@
|
||||
(let (confirm-kill-processes)
|
||||
(delete-window win)
|
||||
(ignore-errors (kill-buffer eshell-buffer)))
|
||||
(with-current-buffer (pop-to-buffer eshell-buffer)
|
||||
(with-current-buffer eshell-buffer
|
||||
(doom-mark-buffer-as-real-h)
|
||||
(if (eq major-mode 'eshell-mode)
|
||||
(run-hooks 'eshell-mode-hook)
|
||||
(eshell-mode))
|
||||
(when command
|
||||
(+eshell-run-command command eshell-buffer))))))
|
||||
(+eshell-run-command command eshell-buffer)))
|
||||
(pop-to-buffer eshell-buffer))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +eshell/here (&optional command)
|
||||
|
@ -73,11 +73,12 @@ If popup is focused, kill it."
|
||||
(set-process-query-on-exit-flag (get-buffer-process buffer) nil)
|
||||
(delete-window win)
|
||||
(ignore-errors (kill-buffer buffer)))
|
||||
(with-current-buffer (pop-to-buffer buffer)
|
||||
(with-current-buffer buffer
|
||||
(if (not (eq major-mode 'shell-mode))
|
||||
(shell buffer)
|
||||
(cd dir)
|
||||
(run-mode-hooks 'shell-mode-hook))))
|
||||
(run-mode-hooks 'shell-mode-hook)))
|
||||
(pop-to-buffer buffer))
|
||||
(when-let (process (get-buffer-process buffer))
|
||||
(set-process-sentinel process #'+shell--sentinel)
|
||||
(+shell--send-input buffer command))))
|
||||
|
Reference in New Issue
Block a user