From e8aa293bc0bfeb06d1d44a1f91778592d98ab409 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 23 Dec 2019 00:02:10 -0500 Subject: [PATCH] Defer tty-run-terminal-initialization to window-setup-hook This seems to work just as well, and ensures it runs in time for interactive use. --- core/core.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/core.el b/core/core.el index 85a535ca8..5f1b21899 100644 --- a/core/core.el +++ b/core/core.el @@ -273,14 +273,15 @@ users).") gcmh-verbose doom-debug-mode) (add-hook 'focus-out-hook #'gcmh-idle-garbage-collect))) -;; HACK `tty-run-terminal-initialization' is *tremendously* slow. Disabling it -;; completely could have side-effects, so we defer it until later. +;; HACK `tty-run-terminal-initialization' is *tremendously* slow for some +;; reason. Disabling it completely could have many side-effects, so we +;; defer it until later. (unless (display-graphic-p) (advice-add #'tty-run-terminal-initialization :override #'ignore) - (add-transient-hook! 'pre-command-hook - (advice-remove #'tty-run-terminal-initialization #'ignore) - (dolist (frame (frame-list)) - (tty-run-terminal-initialization frame nil t)))) + (add-hook! 'window-setup-hook + (defun doom-init-tty-h () + (advice-remove #'tty-run-terminal-initialization #'ignore) + (tty-run-terminal-initialization (selected-frame) nil t)))) ;;