]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix eshell/clear not working if the output has a small line count
authorVibhav Pant <vibhavp@gmail.com>
Wed, 28 Oct 2015 17:07:34 +0000 (22:37 +0530)
committerVibhav Pant <vibhavp@gmail.com>
Wed, 28 Oct 2015 21:38:10 +0000 (03:08 +0530)
* 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.

lisp/eshell/esh-mode.el

index 3df820d59568e2b81004d70db91cef69e2f05a18..9cc9d34eafd51aec69347c6ca5b19e593863c772 100644 (file)
@@ -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."