unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* eshell clear
@ 2015-06-24  6:49 Luca Ferrari
  2015-06-24 14:33 ` Sauli Heinola
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Luca Ferrari @ 2015-06-24  6:49 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,
this should be trivial, but how can I clear an eshell buffer
(something similar to 'clear' command in many shells)?

Thanks,
Luca



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

* Re: eshell clear
  2015-06-24  6:49 eshell clear Luca Ferrari
@ 2015-06-24 14:33 ` Sauli Heinola
  2015-06-24 23:33 ` Emanuel Berg
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Sauli Heinola @ 2015-06-24 14:33 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

* Luca Ferrari <fluca1978-97W46K3QqA41GQ1Ptb7lUw@public.gmane.org>:
> Hi,
> this should be trivial, but how can I clear an eshell buffer
> (something similar to 'clear' command in many shells)?

You can write a function to do what you want.

--8<---------------cut here---------------start------------->8---
(defun eshell/clear ()
      "Clear the eshell buffer."
      (interactive)
      (let ((inhibit-read-only t))
        (erase-buffer)))
--8<---------------cut here---------------end--------------->8---

-- 
It's a bad trip but I'll take it.




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

* Re: eshell clear
  2015-06-24  6:49 eshell clear Luca Ferrari
  2015-06-24 14:33 ` Sauli Heinola
@ 2015-06-24 23:33 ` Emanuel Berg
  2015-06-25  2:17 ` Bob Proulx
  2015-07-03 11:54 ` Nicolas Richard
  3 siblings, 0 replies; 6+ messages in thread
From: Emanuel Berg @ 2015-06-24 23:33 UTC (permalink / raw)
  To: help-gnu-emacs

Luca Ferrari <fluca1978@infinito.it> writes:

> Hi, this should be trivial, but how can I clear an
> eshell buffer (something similar to 'clear' command
> in many shells)?

I don't know, but you don't need that. You get crazy
clearing the screen all the time. Accept there are old
commands and data there, learn to focus on the new
task still. It helps :)

-- 
underground experts united
http://user.it.uu.se/~embe8573




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

* Re: eshell clear
  2015-06-24  6:49 eshell clear Luca Ferrari
  2015-06-24 14:33 ` Sauli Heinola
  2015-06-24 23:33 ` Emanuel Berg
@ 2015-06-25  2:17 ` Bob Proulx
  2015-07-03 11:54 ` Nicolas Richard
  3 siblings, 0 replies; 6+ messages in thread
From: Bob Proulx @ 2015-06-25  2:17 UTC (permalink / raw)
  To: help-gnu-emacs

Luca Ferrari wrote:
> this should be trivial, but how can I clear an eshell buffer
> (something similar to 'clear' command in many shells)?

There is C-c C-o eshell-kill-output which clears the output of the
last command.  Not perfect but it has been standard for a long time.

[I don't usually use eshell but I use the regular shell mode all of the
time.  In the regular shell if I want to clear the buffer I run C-x h
to mark the entire buffer and C-w to cut all of it and then Enter to
get a prompt back again.]

Bob



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

* Re: eshell clear
  2015-06-24  6:49 eshell clear Luca Ferrari
                   ` (2 preceding siblings ...)
  2015-06-25  2:17 ` Bob Proulx
@ 2015-07-03 11:54 ` Nicolas Richard
  3 siblings, 0 replies; 6+ messages in thread
From: Nicolas Richard @ 2015-07-03 11:54 UTC (permalink / raw)
  To: Luca Ferrari; +Cc: help-gnu-emacs

Luca Ferrari <fluca1978@infinito.it> writes:

> Hi,
> this should be trivial, but how can I clear an eshell buffer
> (something similar to 'clear' command in many shells)?

C-c C-t will truncate the buffer to leave just
eshell-buffer-maximum-lines lines.

Based on that, you can do :
(defun luca/eshell-clear-buffer ()
  (interactive)
  (let ((eshell-buffer-maximum-lines 0))
    (eshell-truncate-buffer)))

-- 
Nico.



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

* Re: eshell clear
       [not found] <mailman.5549.1435128563.904.help-gnu-emacs@gnu.org>
@ 2015-07-03 13:11 ` Raffaele Ricciardi
  0 siblings, 0 replies; 6+ messages in thread
From: Raffaele Ricciardi @ 2015-07-03 13:11 UTC (permalink / raw)
  To: help-gnu-emacs

On 24/06/15 08:49, Luca Ferrari wrote:
> Hi,
> this should be trivial, but how can I clear an eshell buffer
> (something similar to 'clear' command in many shells)?

In terminal emulators, `clear` does not erase the content of the window;
`clear` just moves the current line to the top of the window. In Emacs,
this can be accomplished with:

C-1 C-l




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

end of thread, other threads:[~2015-07-03 13:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-24  6:49 eshell clear Luca Ferrari
2015-06-24 14:33 ` Sauli Heinola
2015-06-24 23:33 ` Emanuel Berg
2015-06-25  2:17 ` Bob Proulx
2015-07-03 11:54 ` Nicolas Richard
     [not found] <mailman.5549.1435128563.904.help-gnu-emacs@gnu.org>
2015-07-03 13:11 ` Raffaele Ricciardi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).