emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell


From: Richard M. Stallman
Subject: Re: shell
Date: Tue, 26 Jul 2005 09:21:28 -0400

    Sure, some hook runs when output goes to a shell buffer,
    which notices the time and whether or not the user can see it.
    Compare to earlier tempo and visibility.  When invisible,
    include the last line or so of output with the password prompt.

I think just the latter would be enough for now.
This seems to work--does it work for you?

*** comint.el   22 Jul 2005 00:55:52 -0400      1.328
--- comint.el   26 Jul 2005 08:44:15 -0400      
***************
*** 1935,1949 ****
  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 (read-passwd (or prompt "Non-echoed text: "))))
          (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.
--- 1935,1955 ----
  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)))
!       (prefix
!        (if (eq (window-buffer (selected-window)) (current-buffer))
!            ""
!          (format "(In buffer %s) "
!                  (current-buffer)))))
      (if proc
!       (let ((str (read-passwd (concat prefix
!                                       (or prompt "Non-echoed text: ")))))
          (if (stringp str)
              (progn
                (comint-snapshot-last-prompt)
                (funcall comint-input-sender proc str))
            (message "Warning: text will be echoed")))
!       (error "Buffer %s has no process" (current-buffer)))))
  
  (defun comint-watch-for-password-prompt (string)
    "Prompt in the minibuffer for password and send without echoing.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]