Yeah, it's a seamless experience to run a program in shell-mode that invokes $EDITOR and it just pops into a new buffer. Edit, hit C-x #, and you're back at the shell.
(setenv "EDITOR" "/usr/bin/emacsclient -c")
If you do that, it should cause any child processes (e.g.: vterm) to inherit the replaced EDITOR variable and properly open new editor frames instead of trying to do a terminal takeover. (defun open-term-here ()
"open st in `default-directory`"
(interactive)
(call-process-shell-command
(concat "st bash -c \"cd "
default-directory
" && exec zsh\"")
nil 0)) (defun tmux-here ()
(interactive)
(if (not (eq (getenv "TMUX") ""))
(shell-command (format "tmux new-window -c %s" default-directory))
(error "Not inside a tmux session.")))
I know, I know, tmux is slow and should never be used. I like it, OK.