mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -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)
|
(let (confirm-kill-processes)
|
||||||
(delete-window win)
|
(delete-window win)
|
||||||
(ignore-errors (kill-buffer eshell-buffer)))
|
(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)
|
(doom-mark-buffer-as-real-h)
|
||||||
(if (eq major-mode 'eshell-mode)
|
(if (eq major-mode 'eshell-mode)
|
||||||
(run-hooks 'eshell-mode-hook)
|
(run-hooks 'eshell-mode-hook)
|
||||||
(eshell-mode))
|
(eshell-mode))
|
||||||
(when command
|
(when command
|
||||||
(+eshell-run-command command eshell-buffer))))))
|
(+eshell-run-command command eshell-buffer)))
|
||||||
|
(pop-to-buffer eshell-buffer))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +eshell/here (&optional command)
|
(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)
|
(set-process-query-on-exit-flag (get-buffer-process buffer) nil)
|
||||||
(delete-window win)
|
(delete-window win)
|
||||||
(ignore-errors (kill-buffer buffer)))
|
(ignore-errors (kill-buffer buffer)))
|
||||||
(with-current-buffer (pop-to-buffer buffer)
|
(with-current-buffer buffer
|
||||||
(if (not (eq major-mode 'shell-mode))
|
(if (not (eq major-mode 'shell-mode))
|
||||||
(shell buffer)
|
(shell buffer)
|
||||||
(cd dir)
|
(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))
|
(when-let (process (get-buffer-process buffer))
|
||||||
(set-process-sentinel process #'+shell--sentinel)
|
(set-process-sentinel process #'+shell--sentinel)
|
||||||
(+shell--send-input buffer command))))
|
(+shell--send-input buffer command))))
|
||||||
|
Reference in New Issue
Block a user