Set up EShell to use VTerm as its visual exec runner

This commit is contained in:
Jeremy Dormitzer 2019-12-27 12:07:05 -05:00
parent cbb0aa69f1
commit b7c4e383a2

View File

@ -4001,9 +4001,22 @@ Spotify in Emacs!
* VTerm * VTerm
A better terminal emulator for Emacs. Replaces ansi-term, not EShell. A better terminal emulator for Emacs. Replaces ansi-term, not EShell.
#+BEGIN_SRC emacs-lisp #+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 (use-package vterm
:if module-file-suffix :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) (defun open-vterm (&optional new-buffer)
(interactive "P") (interactive "P")