From 7a3bdc88941f90c5506165ddf4b9d12f51ba9ea3 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 2 Sep 2017 08:17:48 -0400 Subject: [PATCH] [?] Only match password prompts in part of line (Bug#28329) * lisp/eshell/esh-mode.el (eshell-password-prompt-regexp): Add beginning of line anchor, and use {,80} instead of * to restrict matches in long lines. --- lisp/eshell/esh-mode.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index 80844c3a64..9f80700c6a 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -179,7 +179,10 @@ eshell-preoutput-filter-functions :group 'eshell-mode) (defcustom eshell-password-prompt-regexp - (format "\\(%s\\)[^::៖]*[::៖]\\s *\\'" (regexp-opt password-word-equivalents)) + ;; Assume prompt will show up near the beginning of a line, this + ;; should prevent excessive regexp searches on long lines. + (format "^.\\{,80\\}%s[^::៖]\\{,80\\}[::៖]\\s-*\\'" + (regexp-opt password-word-equivalents)) "Regexp matching prompts for passwords in the inferior process. This is used by `eshell-watch-for-password-prompt'." :type 'regexp -- 2.11.0