*** comint-21.3.el Thu Sep 25 07:13:32 2003 --- comint.el Thu Sep 25 07:33:26 2003 *************** *** 1874,1880 **** filter and C-g is pressed, this function returns nil rather than a string). Note that the keystrokes comprising the text can still be recovered ! \(temporarily) with \\[view-lossage]. Some people find this worrysome. Once the caller uses the password, it can erase the password by doing (fillarray STRING 0)." (let ((ans "") --- 1874,1881 ---- filter and C-g is pressed, this function returns nil rather than a string). Note that the keystrokes comprising the text can still be recovered ! \(temporarily) with \\[view-lossage]. Some people find this worrysome (see, ! however, `clear-this-command-keys'). Once the caller uses the password, it can erase the password by doing (fillarray STRING 0)." (let ((ans "") *************** *** 1921,1944 **** (message "") ans))) ! (defun send-invisible (str) "Read a string without echoing. Then send it to the process running in the current buffer. The string is sent using `comint-input-sender'. Security bug: your string can still be temporarily recovered with ! \\[view-lossage]." (interactive "P") ; Defeat snooping via C-x ESC ESC (let ((proc (get-buffer-process (current-buffer)))) ! (cond ((not proc) ! (error "Current buffer has no process")) ! ((stringp str) ! (comint-snapshot-last-prompt) ! (funcall comint-input-sender proc str)) ! (t ! (let ((str (comint-read-noecho "Non-echoed text: " t))) ! (if (stringp str) ! (send-invisible str) ! (message "Warning: text will be echoed"))))))) (defun comint-watch-for-password-prompt (string) "Prompt in the minibuffer for password and send without echoing. --- 1922,1943 ---- (message "") ans))) ! (defun send-invisible (&optional prompt) "Read a string without echoing. Then send it to the process running in the current buffer. The string is sent using `comint-input-sender'. Security bug: your string can still be temporarily recovered with ! \\[view-lossage]; `clear-this-command-keys' can fix that." (interactive "P") ; Defeat snooping via C-x ESC ESC (let ((proc (get-buffer-process (current-buffer)))) ! (if proc ! (let ((str (comint-read-noecho (or prompt "Non-echoed text: ") t))) ! (if (stringp str) ! (progn ! (comint-snapshot-last-prompt) ! (funcall comint-input-sender proc str)) ! (message "Warning: text will be echoed"))) ! (error "Current buffer has no process")))) (defun comint-watch-for-password-prompt (string) "Prompt in the minibuffer for password and send without echoing. *************** *** 1948,1955 **** This function could be in the list `comint-output-filter-functions'." (when (string-match comint-password-prompt-regexp string) ! (let ((pw (comint-read-noecho string t))) ! (send-invisible pw)))) ;; Low-level process communication --- 1947,1953 ---- This function could be in the list `comint-output-filter-functions'." (when (string-match comint-password-prompt-regexp string) ! (send-invisible string))) ;; Low-level process communication