I would like to have a workflow where I could make my F9 key open up a shell in a split pane, and then have the same key effectively do a
C-x 0 on it. That way I could split, run a command, do some stuff, and go back to the file I was editing.
My attempt at this has some problems:
(defun split-shell-toggle () (interactive) (split-window-below) (eshell)) (global-set-key (kbd "<f9>") 'split-shell-toggle)
In particular, I need to modify the function to check if the pane is visible, and then close the pane if it is. Right now I get this kind of thing:
It keeps splitting again and again. How can I check if the pane is already open, and close it if it is?