diff --git a/emacs/init.org b/emacs/init.org index c970ee8..c6d3637 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -4001,9 +4001,22 @@ Spotify in Emacs! * VTerm A better terminal emulator for Emacs. Replaces ansi-term, not EShell. #+BEGIN_SRC emacs-lisp + (defun eshell-exec-in-vterm (&rest args) + (let* ((program (car args)) + (buf (generate-new-buffer + (concat "*" (file-name-nondirectory program) "*")))) + (with-current-buffer buf + (vterm-mode) + (vterm-send-string (concat (s-join " " args) "\n"))) + (switch-to-buffer buf))) + (use-package vterm :if module-file-suffix - :commands (vterm vterm-other-window)) + :init + (with-eval-after-load 'em-term + (defun eshell-exec-visual (&rest args) + (apply #'eshell-exec-in-vterm args))) + :commands (vterm vterm-other-window vterm-mode)) (defun open-vterm (&optional new-buffer) (interactive "P")