aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Prior2021-02-18 12:48:28 +0100
committerLars Ingebrigtsen2021-02-18 12:48:39 +0100
commit850f18ef23ded4aff38afee89de7980e1c9dd1fd (patch)
tree9384715666360de96aadd0d399561ee96063bb47
parentc977370dd734be12ffbaf0da2f3db529d6175b62 (diff)
downloademacs-850f18ef23ded4aff38afee89de7980e1c9dd1fd.tar.gz
emacs-850f18ef23ded4aff38afee89de7980e1c9dd1fd.zip
Allow newlines in password prompts again in comint
* lisp/comint.el (comint-password-prompt-regexp): Match all whitespace (including newline) at the end of the passphrase, not just space and \t (bug#46609). (comint-watch-for-password-prompt): Remove trailing newlines from the prompt (bug#46609). Copyright-paperwork-exempt: yes
-rw-r--r--lisp/comint.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index f5abd1a5bc3..24ef0f239b2 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -366,7 +366,7 @@ This variable is buffer-local."
366 "\\(?:" (regexp-opt password-word-equivalents) "\\|Response\\)" 366 "\\(?:" (regexp-opt password-word-equivalents) "\\|Response\\)"
367 "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?" 367 "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?"
368 ;; "[[:alpha:]]" used to be "for", which fails to match non-English. 368 ;; "[[:alpha:]]" used to be "for", which fails to match non-English.
369 "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:blank:]]*\\'") 369 "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:space:]]*\\'")
370 "Regexp matching prompts for passwords in the inferior process. 370 "Regexp matching prompts for passwords in the inferior process.
371This is used by `comint-watch-for-password-prompt'." 371This is used by `comint-watch-for-password-prompt'."
372 :version "27.1" 372 :version "27.1"
@@ -2405,6 +2405,8 @@ This function could be in the list `comint-output-filter-functions'."
2405 (string-match comint-password-prompt-regexp string)) 2405 (string-match comint-password-prompt-regexp string))
2406 (when (string-match "^[ \n\r\t\v\f\b\a]+" string) 2406 (when (string-match "^[ \n\r\t\v\f\b\a]+" string)
2407 (setq string (replace-match "" t t string))) 2407 (setq string (replace-match "" t t string)))
2408 (when (string-match "\n+\\'" string)
2409 (setq string (replace-match "" t t string)))
2408 (let ((comint--prompt-recursion-depth (1+ comint--prompt-recursion-depth))) 2410 (let ((comint--prompt-recursion-depth (1+ comint--prompt-recursion-depth)))
2409 (if (> comint--prompt-recursion-depth 10) 2411 (if (> comint--prompt-recursion-depth 10)
2410 (message "Password prompt recursion too deep") 2412 (message "Password prompt recursion too deep")