          (or buffer
              (if (eq major-mode 'eshell-mode)
                  (current-buffer)
-               (cl-find-if #'buffer-live-p (ring-elements +eshell-buffers))))))
+               (cl-find-if #'buffer-live-p (+eshell-buffers))))))
     (unless buffer
       (user-error "No living eshell buffers available"))
     (unless (buffer-live-p buffer)

  "Interactively switch to another eshell buffer."
  (interactive
   (let ((buffers (doom-buffers-in-mode
                   'eshell-mode (delq (current-buffer) (ring-elements +eshell-buffers)))))
     (if (not buffers)
         (user-error "No eshell buffers are available")
       (list


(defun +eshell--unused-buffer (&optional new-p)
  (or (unless new-p
        (cl-loop for buf in (+eshell-buffers)
                 if (and (buffer-live-p buf)
                         (not (get-buffer-window buf t)))
                 return buf))
