Function: ghostel--password-prompt-detected-p

ghostel--password-prompt-detected-p is a natively compiled function defined in ghostel.el.

Signature

(ghostel--password-prompt-detected-p)

Documentation

Return non-nil if the foreground program looks like it's reading a password.

Two arms:

  - Zig heuristic (ghostel--pty-password-input-p): the current
    PTY is in canonical mode with echo off. Catches local sudo, ssh's
    own password prompt, gpg, etc.

  - cursor-row regex (ghostel-password-prompt-regex, defaulting to
    comint-password-prompt-regexp). Used when ghostel--remote-shell-p
    indicates a remote shell, where the remote pty's canonical+!echo state
    isn't visible through a local pty probe.

Returns nil on miss, or a symbol naming the arm on hit (zig orregex).

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
(defun ghostel--password-prompt-detected-p ()
  "Return non-nil if the foreground program looks like it's reading a password.
Two arms:

  - Zig heuristic (`ghostel--pty-password-input-p'): the current
    PTY is in canonical mode with echo off.  Catches local sudo, ssh's
    own password prompt, gpg, etc.

  - cursor-row regex (`ghostel-password-prompt-regex', defaulting to
    `comint-password-prompt-regexp').  Used when `ghostel--remote-shell-p'
    indicates a remote shell, where the remote pty's canonical+!echo state
    isn't visible through a local pty probe.

Returns nil on miss, or a symbol naming the arm on hit (`zig' or`regex')."
  (if (ghostel--remote-shell-p)
      (when (ghostel--password-regex-matches-cursor-row-p) 'regex)
    (when (ghostel--pty-password-input-p ghostel--term) 'zig)))