   (let ((buf (+eshell-get-or-create-buffer)))
     (with-current-buffer buf
       (unless (eq major-mode 'eshell-mode) (eshell-mode)))
-    (switch-to-buffer buf)
+    (if (eq major-mode 'eshell-mode)
+        (pop-to-buffer buf)
+      (switch-to-buffer buf))
     (when command
       (+eshell-run-command command))))
 

    (delete-char arg)))

;;;###autoload
(defun +eshell/split-below ()
  "Create a new eshell window below the current one."
  (interactive)
  (select-window (split-window-vertically))
  (+eshell/open))

;;;###autoload
(defun +eshell/split-right ()
  "Create a new eshell window to the right of the current one."
  (interactive)
  (select-window (split-window-horizontally))
  (+eshell/open))

               return buf)
      (generate-new-buffer +eshell-buffer-name)))


;;
;; Commands
