Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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

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

Then I also added a key-binding:

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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