Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!rpi!netserv2!deven From: deven@rpi.edu (Deven T. Corzine) Newsgroups: gnu.emacs Subject: Re: Getting Emacs to not echo characters Message-ID: Date: 9 Dec 89 01:27:27 GMT References: <842@megatek.UUCP> Organization: Rensselaer Polytechnic Institute, Troy, NY Lines: 67 In-Reply-To: hollen@eta.megatek.uucp's message of 6 Dec 89 18:28:21 GMT On 6 Dec 89 18:28:21 GMT, hollen@eta.megatek.uucp (Dion Hollenbeck) said: Dion> Deven T. Corzine thoughtfully posted a solution to this, but it Dion> does not quite fit my problem. When I am typing in a password, Dion> I am in an Emacs shell and are doing a "rlogin" to another host Dion> which is asking for my password. Maybe somehow turning off Dion> echoing in this shell would work. Dion> The other problem I am having is also in the shell, after I have Dion> completed the remote login. Emacs echoes everything to the Dion> screen in addition to the remote host echoing it and every line Dion> is followed my ^M. Is there a mode or process-filter which I Dion> can apply to get rid of this behaviour? The same things were bothering me, so I wrote a simple fix for them. The following is from my .emacs: -------- (defun shell-filter (proc str) "Output filter for shell-mode buffers." (save-excursion (set-buffer (process-buffer proc)) (goto-char (process-mark proc)) (let ((start (point)) end) (insert-before-markers str) (setq end (point)) (goto-char start) (while (or (looking-at "^\r\\|\r$") (re-search-forward "^\r\\|\r$" end t)) (replace-match "")) (goto-char start) (while (or (looking-at "\C-g") (re-search-forward "\C-g" end t)) (replace-match "") (ding 'noterminate))))) (defun shell-save-history () "Hook for shell-mode to delete the input from the buffer after sending it. (so double-echo is avoided)" (delete-region last-input-start last-input-end)) (setq shell-mode-hook '(lambda () (set-process-filter (get-buffer-process (current-buffer)) 'shell-filter)) shell-read-history nil) -------- The filter removes ^M's from the beginning or end of a line, and removes any ^G's, dinging in their place. The shell-save-history function (is it called by the standard shell.el distribution? hmm.) does retroactive un-echoing. it deletes the input, which is normally then echoed by the shell or remote host. In the case of password prompting, it is not re-echoed. So, the password shows while you type it, but not after. Not ideal, but an acceptable compromise for me. (just put your hand over the screen or something. :-) Deven -- Deven T. Corzine Internet: deven@rpi.edu, shadow@pawl.rpi.edu Snail: 2151 12th St. Apt. 4, Troy, NY 12180 Phone: (518) 274-0327 Bitnet: deven@rpitsmts, userfxb6@rpitsmts UUCP: uunet!rpi!deven Simple things should be simple and complex things should be possible.