From d35864ca6be969b6426c6ff2e7f46813e591370c Mon Sep 17 00:00:00 2001 From: Akib Azmain Turja Date: Sun, 4 Dec 2022 22:49:56 +0600 Subject: [PATCH] Calculate the number of lines on window properly * eat.el (eat-exec, eat--eshell-setup-proc-and-term) (eat--eshell-adjust-make-process-args) (eat--eshell-synchronize-scroll): Calculate the number of available lines on window properly. --- eat.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eat.el b/eat.el index 3346138..6eaacf3 100644 --- a/eat.el +++ b/eat.el @@ -4572,7 +4572,7 @@ same Eat buffer. The hook `eat-exec-hook' is run after each exec." (when-let* ((window (get-buffer-window nil t))) (with-selected-window window (eat-term-resize eat--terminal (window-max-chars-per-line) - (window-text-height)))) + (floor (window-screen-lines))))) (setf (eat-term-input-function eat--terminal) #'eat--send-input (eat-term-set-cursor-function eat--terminal) #'eat--set-cursor @@ -4850,7 +4850,7 @@ PROGRAM can be a shell command." (when-let* ((window (get-buffer-window nil t))) (with-selected-window window (eat-term-resize eat--terminal (window-max-chars-per-line) - (window-text-height)))) + (floor (window-screen-lines))))) (eat-term-redisplay eat--terminal) (setq-local eshell-output-filter-functions '(eat--eshell-output-filter)) @@ -4969,7 +4969,7 @@ modify its argument to change the filter, the sentinel and invoke `("/usr/bin/env" "sh" "-c" ,(format "stty -nl echo rows %d columns %d \ sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\"" - (window-text-height) + (floor (window-screen-lines)) (window-max-chars-per-line) null-device) ".." ,@(plist-get plist :command))) @@ -5001,7 +5001,7 @@ sane 2>%s ; if [ $1 = .. ]; then shift; fi; exec \"$@\"" (narrow-to-region (eat-term-beginning eat--terminal) (eat-term-end eat--terminal)) - (let ((start-line (- (window-text-height window) + (let ((start-line (- (floor (window-screen-lines)) (line-number-at-pos (point-max))))) (goto-char (point-min)) (widen)