Is there an ESS version of the Clear Console command that can be found in the RGui(Ctrl-L)?
I want to have a blank * R * buffer.
Is there an ESS version of the Clear Console command that can be found in the RGui(Ctrl-L)?
I want to have a blank * R * buffer.
The easy way would be to mark the whole buffer (C-x h
), delete it, and then hit RET
to have the prompt come back.
From the EmacsWiki, this Elisp function works well for me:
(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)))
Put this in your ~/.emacs.d/init.el
and execute with M-x clear-shell
, or bind it to a key in your init.el
with something like:
(global-set-key (kbd "\C-x c") 'clear-shell)