I use shells running under Emacs (via M-x shell
) under a variety of settings1.
In all these settings, I use the same .emacs
file. Nevertheless I observe an inconsistency, as described below.
In some settings, when I run a command that requires a password (e.g. ssh) from such a shell session, the command's prompt for the password will appear in the mini-buffer, and the password itself will be hidden (as the user types, all that appears on the screen are dots).
In other settings, however, the same command will result in a prompt that appears in the main shell-interaction buffer (as opposed to the mini-buffer), and the password typed by the user will be visible.
Does anyone know what governs whether Emacs will hide passwords in such situations or not?
1 I use the term "setting" to capture a wide number of factors, including the version of Emacs, the underlying OS, whether or not Emacs is running through ssh, whether or not Emacs is running in text-only mode, and if so, the terminal emulator, whether or not Emacs is running under gnu-screen, etc.
comint-password-prompt-regexp
and in the other it does not. Are you sure it's the same command? Check the password prompt carefully.Password for [email protected]:
, and in another it produces the prompt([email protected]) Password:
. I'd be happy to accept your comment as the answer, if you post it as such.