In bash, I can clear the screen with the clear command and I can clear the whole "buffer" with the reset command.

I'm looking to accomplish the reset in Emacs *shell* terminal. Is there a command / keyboard binding for this?

link|improve this question

feedback

1 Answer

up vote 2 down vote accepted

Answering my own question. Found the answer on this site:

(defun clear-shell ()
   (interactive)
  (let ((old-max comint-buffer-maximum-size))
    (setq comint-buffer-maximum-size 0)
    (comint-truncate-buffer)
    (setq comint-buffer-maximum-size old-max))) 

Then I also added a key-binding:

(global-set-key "\C-f" 'clear-shell)
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.