Command to clear shell while using emacs shell

前端 未结 6 1075
梦毁少年i
梦毁少年i 2020-12-23 18:52

Is there a builtin command to clear shell while using shell in emacs?

If not, is there an elisp function to achieve the same?

6条回答
  •  忘掉有多难
    2020-12-23 19:18

    If you find, you can't use erase-buffer and shows text is read only. You can use following replace function.

      (defun eshell/clear ()
      "Hi, you will clear the eshell buffer."
      (interactive)
      (let ((inhibit-read-only t))
        (erase-buffer)
        (message "erase eshell buffer")))
    

提交回复
热议问题