diff options
| -rw-r--r-- | lisp/comint.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 3f77ea99050..589aba9321a 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -1935,15 +1935,21 @@ The string is sent using `comint-input-sender'. | |||
| 1935 | Security bug: your string can still be temporarily recovered with | 1935 | Security bug: your string can still be temporarily recovered with |
| 1936 | \\[view-lossage]; `clear-this-command-keys' can fix that." | 1936 | \\[view-lossage]; `clear-this-command-keys' can fix that." |
| 1937 | (interactive "P") ; Defeat snooping via C-x ESC ESC | 1937 | (interactive "P") ; Defeat snooping via C-x ESC ESC |
| 1938 | (let ((proc (get-buffer-process (current-buffer)))) | 1938 | (let ((proc (get-buffer-process (current-buffer))) |
| 1939 | (prefix | ||
| 1940 | (if (eq (window-buffer (selected-window)) (current-buffer)) | ||
| 1941 | "" | ||
| 1942 | (format "(In buffer %s) " | ||
| 1943 | (current-buffer))))) | ||
| 1939 | (if proc | 1944 | (if proc |
| 1940 | (let ((str (read-passwd (or prompt "Non-echoed text: ")))) | 1945 | (let ((str (read-passwd (concat prefix |
| 1946 | (or prompt "Non-echoed text: "))))) | ||
| 1941 | (if (stringp str) | 1947 | (if (stringp str) |
| 1942 | (progn | 1948 | (progn |
| 1943 | (comint-snapshot-last-prompt) | 1949 | (comint-snapshot-last-prompt) |
| 1944 | (funcall comint-input-sender proc str)) | 1950 | (funcall comint-input-sender proc str)) |
| 1945 | (message "Warning: text will be echoed"))) | 1951 | (message "Warning: text will be echoed"))) |
| 1946 | (error "Current buffer has no process")))) | 1952 | (error "Buffer %s has no process" (current-buffer))))) |
| 1947 | 1953 | ||
| 1948 | (defun comint-watch-for-password-prompt (string) | 1954 | (defun comint-watch-for-password-prompt (string) |
| 1949 | "Prompt in the minibuffer for password and send without echoing. | 1955 | "Prompt in the minibuffer for password and send without echoing. |