From 56b62471dbe0d50dc94026c84435c8646b8370b7 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sat, 23 May 2020 17:14:44 +0200 Subject: [PATCH] shell: Fix prompt to support [env] prepended to second line. --- .emacs.d/lisp/init-shell.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.emacs.d/lisp/init-shell.el b/.emacs.d/lisp/init-shell.el index 07e05523..21d08224 100644 --- a/.emacs.d/lisp/init-shell.el +++ b/.emacs.d/lisp/init-shell.el @@ -36,7 +36,7 @@ prefix arg shell buffer doesn't exists, create it and switch to it." (set (make-variable-buffer-local 'comint-input-history-ignore) (regexp-opt '("^#" "^ " "^cd "))) (setq comint-prompt-regexp "^[^#$%>]* -[#$%>] *")) +[^#$%>]*[#$%>] *")) (add-hook 'shell-mode-hook 'ambrevar/shell-setup) @@ -124,4 +124,6 @@ In normal circumstances this input is additionally filtered by (ambrevar/shell-prompt-begin-position)))))) (define-key shell-mode-map (kbd "C-x n d") 'ambrevar/shell-narrow-to-prompt) +(define-key shell-mode-map (kbd "C-x M-O") 'comint-truncate-buffer) + (provide 'init-shell)