From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Newsgroups: gmane.emacs.help Subject: Re: How to disable command echoing in Emacs shell? Date: Tue, 19 Oct 2010 09:39:44 +0200 Organization: Sebastien Vauban Message-ID: <801v7mskan.fsf@mundaneum.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291881318 21462 80.91.229.12 (9 Dec 2010 07:55:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 07:55:18 +0000 (UTC) To: help-gnu-emacs-mXXj517/zsQ@public.gmane.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Thu Dec 09 08:55:14 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQbLN-0006UD-HU for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 08:55:13 +0100 Original-Received: from localhost ([127.0.0.1]:45719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQYwV-0004x1-KI for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 00:21:23 -0500 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 118 Injection-Info: mx03.eternal-september.org; posting-host="No+jx9xcG75RY5G9Zb0asg"; logging-data="24665"; mail-complaints-to="abuse-VVbKFVtnif8H+i2N2EyTrmui9UKz+5OX@public.gmane.org"; posting-account="U2FsdGVkX1/VlcivK0HRc1cV5xQHlFnM" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt) X-Archive: encrypt Cancel-Lock: sha1:Hl+Ml87qtX5IIUGPyHe+Hqi9mP0= sha1:s0FVG79eBkja02Wj1r2Q/7OLt9Y= X-Url: Under construction... Original-Xref: usenet.stanford.edu gnu.emacs.help:181863 X-BeenThere: help-gnu-emacs-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.help:76848 Archived-At: Hello, Barry Margolin wrote: > In article wrote: > >> This question is surprisingly difficult to find an answer for: >>=20 >> How do I turn off the command echoing in *shell*? I want just this: >>=20 >> % date >> Mon Oct 18 19:22:46 EDT 2010 In the same spirit, how to turn on the prompt in *shell*? I am on Windows = XP with Cygwin, and I just see: --8<---------------cut here---------------start------------->8--- ls file1.txt file2.txt file3.txt pwd /cygdrive/c/home/sva --8<---------------cut here---------------end--------------->8--- where `ls' and `pwd' are in *bold*. My settings are: --8<---------------cut here---------------start------------->8--- ;; for single shell commands (setq shell-file-name "bash") ;; use `shell-file-name' as the default shell (when (try-require 'env) (setenv "SHELL" shell-file-name)) ;; switch used to have the shell execute its command line argument (setq shell-command-switch "-c") ;; quote process arguments to ensure correct parsing on Windows (setq w32-quote-process-args t) ;; name of shell used to parse TeX commands (setq TeX-shell shell-file-name) ;; shell argument indicating that next argument is the command (setq TeX-shell-command-option shell-command-switch) ;; for the interactive (sub)shell (setq explicit-shell-file-name shell-file-name) ;; args passed to inferior shell by `M-x shell', if the shell is bash (setq explicit-bash-args '("--noediting" "--login")) ;; FIXME This ensures that /etc/profile gets read (at least for Cygwin). ;; Is this good? ;; general command interpreter in a window stuff (when (try-require 'comint) ;; regexp to recognize prompts in the inferior process (defun set-shell-prompt-regexp () (setq comint-prompt-regexp "^[^#$%>\n]*[#$%>] *")) (add-hook 'shell-mode-hook 'set-shell-prompt-regexp) ;; don't add input matching the last on the input ring (setq-default comint-input-ignoredups t) ;; input to interpreter causes (only) the selected window to scroll (setq-default comint-scroll-to-bottom-on-input "this") ;; output to interpreter causes (only) the selected window to scroll (setq-default comint-scroll-to-bottom-on-output "this") ;; show the maximum output when the window is scrolled (setq-default comint-scroll-show-maximum-output t) ;; ignore short commands as well as duplicates (setq comint-min-history-size 5) (make-variable-buffer-local 'comint-min-history-size) (setq-default comint-input-filter (function (lambda (str) (and (not (string-match "\\`\\s *\\'" str)) (> (length str) comint-min-history-size))))) ;; functions to call after output is inserted into the buffer (setq-default comint-output-filter-functions ;; go to the end of buffer (this can be irritating for ;; some) '(comint-postoutput-scroll-to-bottom)) ;; get rid of the ^M characters (add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m) ;; prompt in the minibuffer for password and send without echoing ;; (for example, with `su' command) (add-hook 'comint-output-filter-functions 'comint-watch-for-password-prompt) ;; use the `up' and `down' arrow keys to traverse through the previous ;; commands (defun my/shell-mode-hook () "Customize my shell-mode." (local-set-key (kbd "") 'comint-previous-input) (local-set-key (kbd "") 'comint-next-input)) (add-hook 'shell-mode-hook 'my/shell-mode-hook)) ;; regexp to match prompts in the inferior shell (setq shell-prompt-pattern (concat "^" (system-name) " [^ ]+ \\[[0-9]+\\] "= )) --8<---------------cut here---------------end--------------->8--- Best regards, Seb --=20 S=C3=A9bastien Vauban