   (let ((buf (current-buffer)))
     (when (+eshell--remove-buffer buf)
       (+eshell--setup-window (get-buffer-window buf) nil)
-      (cond (+eshell--wconf
-             (set-window-configuration +eshell--wconf))
+      (cond ((and (one-window-p)
+                  (window-configuration-p (frame-parameter nil 'saved-wconf)))
+             (set-window-configuration (frame-parameter nil 'saved-wconf))
+             (set-frame-parameter nil 'saved-wconf nil))
             ((one-window-p)
              (let ((prev (save-window-excursion (previous-buffer))))
                (unless (and prev (doom-real-buffer-p prev))

  "Open eshell in a separate workspace. Requires the (:feature workspaces)
module to be loaded."
  (interactive "P")
  (let ((default-directory (if arg default-directory (doom-project-root))))
    (setq +eshell--wconf (current-window-configuration))
    (delete-other-windows)
    (with-current-buffer (+eshell/open arg command)
      (setq-local +eshell--wconf (current-window-configuration)))))


;;



(defvar +eshell--last-buffer nil)


;;
