From b7c4e383a2a3d8a0140376e9ebb76a3b7897848a Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 27 Dec 2019 12:07:05 -0500 Subject: [PATCH] Set up EShell to use VTerm as its visual exec runner --- emacs/init.org | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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")