all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to disable command echoing in Emacs shell?
@ 2010-10-18 23:23 kj
  2010-10-19  1:40 ` Barry Margolin
  0 siblings, 1 reply; 5+ messages in thread
From: kj @ 2010-10-18 23:23 UTC (permalink / raw)
  To: help-gnu-emacs



This question is surprisingly difficult to find an answer for:

How do I turn off the command echoing in *shell*?  E.g., currently,
the interactions look like this:

% date
date
Mon Oct 18 19:22:46 EDT 2010

I want just this:

% date
Mon Oct 18 19:22:46 EDT 2010


TIA!

~kj


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to disable command echoing in Emacs shell?
  2010-10-18 23:23 How to disable command echoing in Emacs shell? kj
@ 2010-10-19  1:40 ` Barry Margolin
  2010-10-19  7:39   ` Sébastien Vauban
  2010-10-19 12:15   ` kj
  0 siblings, 2 replies; 5+ messages in thread
From: Barry Margolin @ 2010-10-19  1:40 UTC (permalink / raw)
  To: help-gnu-emacs

In article <i9iku8$f1h$1@reader1.panix.com>, kj <no.email@please.post> 
wrote:

> This question is surprisingly difficult to find an answer for:
> 
> How do I turn off the command echoing in *shell*?  E.g., currently,
> the interactions look like this:
> 
> % date
> date
> Mon Oct 18 19:22:46 EDT 2010
> 
> I want just this:
> 
> % date
> Mon Oct 18 19:22:46 EDT 2010
> 
> 
> TIA!
> 
> ~kj

stty -echo

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to disable command echoing in Emacs shell?
  2010-10-19  1:40 ` Barry Margolin
@ 2010-10-19  7:39   ` Sébastien Vauban
  2010-10-19 12:15   ` kj
  1 sibling, 0 replies; 5+ messages in thread
From: Sébastien Vauban @ 2010-10-19  7:39 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Hello,

Barry Margolin wrote:
> In article wrote:
>
>> This question is surprisingly difficult to find an answer for:
>> 
>> How do I turn off the command echoing in *shell*? I want just this:
>> 
>> % 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 "<up>") 'comint-previous-input)
    (local-set-key (kbd "<down>") '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

-- 
Sébastien Vauban


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to disable command echoing in Emacs shell?
  2010-10-19  1:40 ` Barry Margolin
  2010-10-19  7:39   ` Sébastien Vauban
@ 2010-10-19 12:15   ` kj
  2013-11-06 22:17     ` hemalpandya
  1 sibling, 1 reply; 5+ messages in thread
From: kj @ 2010-10-19 12:15 UTC (permalink / raw)
  To: help-gnu-emacs

In <barmar-EC59B0.21400618102010@news.eternal-september.org> Barry Margolin <barmar@alum.mit.edu> writes:

>In article <i9iku8$f1h$1@reader1.panix.com>, kj <no.email@please.post> 
>wrote:

>> This question is surprisingly difficult to find an answer for:
>> 
>> How do I turn off the command echoing in *shell*?  E.g., currently,
>> the interactions look like this:
>> 
>> % date
>> date
>> Mon Oct 18 19:22:46 EDT 2010
>> 
>> I want just this:
>> 
>> % date
>> Mon Oct 18 19:22:46 EDT 2010
>> 
>> 
>> TIA!
>> 
>> ~kj

>stty -echo

Hmm.  That was totally unexpected.  I thought it would have been
some Emacs setting.  (No wonder I couldn't find the answer.)  Many
thanks!

~kj


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: How to disable command echoing in Emacs shell?
  2010-10-19 12:15   ` kj
@ 2013-11-06 22:17     ` hemalpandya
  0 siblings, 0 replies; 5+ messages in thread
From: hemalpandya @ 2013-11-06 22:17 UTC (permalink / raw)
  To: help-gnu-emacs

On Tuesday, October 19, 2010 5:15:45 AM UTC-7, kj wrote:
> In <barmar-EC59B0.21400618102010@news.eternal-september.org> Barry Margolin <barmar@***> writes:
> 
> >In article <i9iku8$f1h$1@reader1.panix.com>, kj <no.email@please.post> 
> >wrote:
> 
> >> This question is surprisingly difficult to find an answer for:
> >> 
> >> How do I turn off the command echoing in *shell*?  E.g., currently,
> >> the interactions look like this:
> >> 
> >> % date
> >> date
> >> Mon Oct 18 19:22:46 EDT 2010
> >> 
> >> I want just this:
> >> 
> >> % date
> >> Mon Oct 18 19:22:46 EDT 2010
> >> 
> >> 
> >> TIA!
> >> 
> >> ~kj
> 
> >stty -echo
> 
> Hmm.  That was totally unexpected.  I thought it would have been
> some Emacs setting.  (No wonder I couldn't find the answer.)  Many
> thanks!
> 
> ~kj

Another option is to set `comint-process-echoes` to `t`, which is indeed an Emacs setting :)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-11-06 22:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-18 23:23 How to disable command echoing in Emacs shell? kj
2010-10-19  1:40 ` Barry Margolin
2010-10-19  7:39   ` Sébastien Vauban
2010-10-19 12:15   ` kj
2013-11-06 22:17     ` hemalpandya

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.