From: Eshel Yaron Date: Mon, 19 Sep 2022 12:05:11 +0000 (+0300) Subject: Use a regexp to detect the prompt in vterm buffers X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2eb042f077c7eac8aeb25ec2207c8c5176649c8a;p=dotfiles.git Use a regexp to detect the prompt in vterm buffers --- diff --git a/.emacs.d/esy.org b/.emacs.d/esy.org index eea040c..7417c27 100644 --- a/.emacs.d/esy.org +++ b/.emacs.d/esy.org @@ -968,6 +968,13 @@ over ssh for remote connections. #+begin_src emacs-lisp (setq vterm-shell "/bin/bash") + (setq vterm-use-vterm-prompt-detection-method nil) + + (defun esy/vterm-mode-hook-function () + (setq-local term-prompt-regexp "^[^#$%>\n]*[#$%>] *")) + + (add-hook 'vterm-mode-hook #'esy/vterm-mode-hook-function) + (defun esy/vterm-with (arg shell) (interactive