Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!rpi!tale From: tale@cs.rpi.edu (Dave Lawrence) Newsgroups: gnu.emacs Subject: Re: Getting Emacs to not echo characters Message-ID: Date: 8 Dec 89 01:47:35 GMT References: <842@megatek.UUCP> Organization: Rensselaer Polytechnic Institute, Troy NY Lines: 64 In article <842@megatek.UUCP> hollen@eta.megatek.uucp (Dion Hollenbeck) writes: Deven T. Corzine thoughtfully posted a solution to this, but it does not quite fit my problem. When I am typing in a password, I am in an Emacs shell and are doing a "rlogin" to another host which is asking for my password. Maybe somehow turning off echoing in this shell would work. The following is from comint.el, a package by Olin Shivers : ;;; These two functions are for entering text you don't want echoed or ;;; saved -- typically passwords to ftp, telnet, or somesuch. ;;; Just enter M-x send-invisible and type in your line. (defun comint-read-noecho (prompt) "Prompt the user with argument PROMPT. Read a single line of text without echoing, and return it. Note that the keystrokes comprising the text can still be recovered (temporarily) with \\[view-lossage]. This may be a security bug for some applications." (let ((echo-keystrokes 0) (answ "") tem) (if (and (stringp prompt) (not (string= (message prompt) ""))) (message prompt)) (while (not(or (= (setq tem (read-char)) ?\^m) (= tem ?\n))) (setq answ (concat answ (char-to-string tem)))) (message "") answ)) (defun send-invisible (str) "Read a string without echoing, and send it to the process running in the current buffer. A new-line is additionally sent. String is not saved on comint input history list. Security bug: your string can still be temporarily recovered with \\[view-lossage]." ; (interactive (list (comint-read-noecho "Enter non-echoed text"))) (interactive "P") ; Defeat snooping via C-x esc (let ((proc (get-buffer-process (current-buffer)))) (if (not proc) (error "Current buffer has no process") (process-send-string proc (if (stringp str) str (comint-read-noecho "Enter non-echoed text"))) (process-send-string proc "\n")))) The other problem I am having is also in the shell, after I have completed the remote login. Emacs echoes everything to the screen in addition to the remote host echoing it and every line is followed my ^M. Is there a mode or process-filter which I can apply to get rid of this behaviour? This sounds like telnet doing this. If you were to use telnet.el it probably wouldn't have the problem, since it deletes the input and removes the the filter blasts C-m characters at the end of lines. shell-mode as currently distributed does no such trimming. This problem is also apparent when using a shell like tcsh which echos characters back and outputs RET LFD pairs. I think BASH tests whether it is running within Emacs, by checking for the EMACS environment variable, to avoid such echoing. Dave -- (setq mail '("tale@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))