I'm trying to write a function which opens or closes an eshell window. So far I have:

    (defun bottom-window-eshell()
      (let ((buf (eshell)))
        (switch-to-buffer (other-buffer buf))
        (switch-to-buffer-other-window buf)))

1 Answer 1


Not sure what you're asking, but maybe something like this helps?

(defun bottom-window-eshell()
  (unless (eq major-mode 'eshell-mode)
    (switch-to-buffer-other-window (eshell))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.