Alexei
Alexei

Reputation: 15664

Emacs. Shell how clean screen?

Windows 7 Emacs 24.5

1.Open shell, by M-x shell.

2.Do some commands.

  1. As result I get screen:

enter image description here

OK. Now I want to clear screen (in Windows consele this is a command "cls").

I want to get the next screen: enter image description here

How I can do this in Emacs shell?

Upvotes: 1

Views: 797

Answers (2)

Alexei
Alexei

Reputation: 15664

This also work:

;; clear content of buffer
(defun clear-buffer-permenantly ()
  "Clear whole buffer, contents is not added to the kill ring"
  (interactive)
  (delete-region (point-min) (point-max))
  )

(global-set-key (kbd "<f12>") 
        (lambda ()
          (interactive)
          (clear-buffer-permenantly)
          (process-send-string nil "\n")))

Upvotes: 0

ewindes
ewindes

Reputation: 810

Run the emacs function "erase-buffer" to clear the buffer.

You could bind a function key to clear your buffer:

(global-set-key (kbd "<f10>") 
        (lambda ()
          (interactive)
          (erase-buffer)
          (process-send-string nil "\n")))

Upvotes: 2

Related Questions