]> git.eshelyaron.com Git - dotfiles.git/commitdiff
Use a regexp to detect the prompt in vterm buffers
authorEshel Yaron <me@eshelyaron.com>
Mon, 19 Sep 2022 12:05:11 +0000 (15:05 +0300)
committerEshel Yaron <me@eshelyaron.com>
Mon, 19 Sep 2022 12:05:11 +0000 (15:05 +0300)
.emacs.d/esy.org

index eea040c98f1d278c61ce6bb6d1f5c6f99cfbed7e..7417c279c15a94fdfe85a7e9b36877bbee3cdf1c 100644 (file)
@@ -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