aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoah Friedman1994-06-29 18:21:34 +0000
committerNoah Friedman1994-06-29 18:21:34 +0000
commit654d89d78e7fe04721f4d9f7f788d8bbc783632f (patch)
tree3e7a11a7a802f09cce5af48411eb6645c4f4e43d
parent5286a84274ebfd70d0659739f8ff4e4fd532c9a7 (diff)
downloademacs-654d89d78e7fe04721f4d9f7f788d8bbc783632f.tar.gz
emacs-654d89d78e7fe04721f4d9f7f788d8bbc783632f.zip
comint-password-prompt-regexp: New variable.
comint-watch-for-password-prompt: Use it.
-rw-r--r--lisp/comint.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/comint.el b/lisp/comint.el
index 3a343303598..469c8c12fcd 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -219,6 +219,10 @@ appears in the buffer.
219 219
220This variable is buffer-local.") 220This variable is buffer-local.")
221 221
222(defvar comint-password-prompt-regexp "\\b[Pp]assword:\\s *\\'"
223 "*Regexp matching prompts for passwords in the inferior process.
224This is used by comint-watch-for-password-prompt.")
225
222;;; Here are the per-interpreter hooks. 226;;; Here are the per-interpreter hooks.
223(defvar comint-get-old-input (function comint-get-old-input-default) 227(defvar comint-get-old-input (function comint-get-old-input-default)
224 "Function that returns old text in comint mode. 228 "Function that returns old text in comint mode.
@@ -1389,10 +1393,11 @@ Security bug: your string can still be temporarily recovered with
1389(defun comint-watch-for-password-prompt (string) 1393(defun comint-watch-for-password-prompt (string)
1390 "Prompt in the minibuffer for password and send without echoing. 1394 "Prompt in the minibuffer for password and send without echoing.
1391This function uses `send-invisible' to read and send a password to the buffer's 1395This function uses `send-invisible' to read and send a password to the buffer's
1392process if STRING contains a password prompt (matches \"^[Pp]assword:\\\\s *\\\\'\"). 1396process if STRING contains a password prompt defined by
1397`comint-password-prompt-regexp'.
1393 1398
1394This function could be in the list `comint-output-filter-functions'." 1399This function could be in the list `comint-output-filter-functions'."
1395 (if (string-match "^[Pp]assword:\\s *\\'" string) 1400 (if (string-match comint-password-prompt-regexp string)
1396 (send-invisible nil))) 1401 (send-invisible nil)))
1397 1402
1398;;; Low-level process communication 1403;;; Low-level process communication