mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-28 07:45:00 +00:00
Fix eshell/clear not working if the output has a small line count
* lisp/eshell/esh-mode.el: (eshell/clear): Use (window-size) as the number of newlines to be inserted. This fixes the issue where eshell/clear wouldn't work if the prompt was not at the bottom of the window, and the output wasn't too long.
This commit is contained in:
parent
d8f82d8199
commit
2765945d61
@ -877,9 +877,8 @@ If SCROLLBACK is non-nil, clear the scrollback contents."
|
||||
(interactive)
|
||||
(if scrollback
|
||||
(eshell/clear-scrollback)
|
||||
(let ((number-newlines (count-lines (window-start) (point))))
|
||||
(insert (make-string number-newlines ?\n))
|
||||
(eshell-send-input))))
|
||||
(insert (make-string (window-size) ?\n))
|
||||
(eshell-send-input)))
|
||||
|
||||
(defun eshell/clear-scrollback ()
|
||||
"Clear the scrollback content of the eshell window."
|
||||
|
Loading…
Reference in New Issue
Block a user