emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-27 850f18e: Allow newlines in password prompts again in comint


From: Lars Ingebrigtsen
Subject: emacs-27 850f18e: Allow newlines in password prompts again in comint
Date: Thu, 18 Feb 2021 06:49:14 -0500 (EST)

branch: emacs-27
commit 850f18ef23ded4aff38afee89de7980e1c9dd1fd
Author: Ryan Prior <rprior@protonmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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
---
 lisp/comint.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/comint.el b/lisp/comint.el
index f5abd1a..24ef0f2 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -366,7 +366,7 @@ This variable is buffer-local."
    "\\(?:" (regexp-opt password-word-equivalents) "\\|Response\\)"
    "\\(?:\\(?:, try\\)? *again\\| (empty for no passphrase)\\| (again)\\)?"
    ;; "[[:alpha:]]" used to be "for", which fails to match non-English.
-   "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:blank:]]*\\'")
+   "\\(?: [[:alpha:]]+ .+\\)?[[:blank:]]*[::៖][[:space:]]*\\'")
   "Regexp matching prompts for passwords in the inferior process.
 This is used by `comint-watch-for-password-prompt'."
   :version "27.1"
@@ -2405,6 +2405,8 @@ This function could be in the list 
`comint-output-filter-functions'."
          (string-match comint-password-prompt-regexp string))
     (when (string-match "^[ \n\r\t\v\f\b\a]+" string)
       (setq string (replace-match "" t t string)))
+    (when (string-match "\n+\\'" string)
+      (setq string (replace-match "" t t string)))
     (let ((comint--prompt-recursion-depth (1+ comint--prompt-recursion-depth)))
       (if (> comint--prompt-recursion-depth 10)
           (message "Password prompt recursion too deep")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]