diff --git a/core/autoload/sessions.el b/core/autoload/sessions.el index 432d6a7b3..b0c6a6ec2 100644 --- a/core/autoload/sessions.el +++ b/core/autoload/sessions.el @@ -65,6 +65,12 @@ "TODO" (add-hook 'window-setup-hook #'doom-load-session 'append)) +;;;###autoload +(when (and command-line-args-left + (not noninteractive)) + (add-to-list 'command-switch-alist + (cons "--restore" #'doom-restore-session-handler))) + ;; ;;; Commands diff --git a/init.el b/init.el index 9f236f0c0..400e553b9 100644 --- a/init.el +++ b/init.el @@ -52,9 +52,6 @@ ;; And let 'er rip! (add-hook 'window-setup-hook #'doom-display-benchmark-h) -(when (cdr command-line-args) - (add-to-list 'command-switch-alist - (cons "--restore" #'doom-restore-session-handler))) (doom-initialize) (doom-initialize-core)