Function: term-watch-for-password-prompt

term-watch-for-password-prompt is a byte-compiled function defined in term.el.gz.

Signature

(term-watch-for-password-prompt STRING)

Documentation

Prompt in the minibuffer for password and send without echoing.

Checks if STRING contains a password prompt as defined by comint-password-prompt-regexp.

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
;; TODO: Maybe combine this with `comint-watch-for-password-prompt'.
(defun term-watch-for-password-prompt (string)
  "Prompt in the minibuffer for password and send without echoing.
Checks if STRING contains a password prompt as defined by
`comint-password-prompt-regexp'."
  (when (term-in-line-mode)
    (when (let ((case-fold-search t))
            (string-match comint-password-prompt-regexp string))
      ;; Use `run-at-time' in order not to pause execution of the
      ;; process filter with a minibuffer
      (run-at-time
       0 nil
       (lambda (current-buf)
         (with-current-buffer current-buf
           (term-send-invisible (read-passwd string))))
       (current-buffer)))))