GNU bug report logs -
#15744
23.3; ansi-term: prompt moves to bottom of screen
Previous Next
Reported by: "Olsen, Stuart J" <stuart_olsen <at> txstate.edu>
Date: Mon, 28 Oct 2013 19:04:02 UTC
Severity: minor
Tags: confirmed, fixed, patch
Found in versions 24.3, 23.3
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi,
Here's a patch that adds a variable `term-scroll-snap-to-bottom` in an attempt resolve this. It defaults to t to preserve current behavior (arguably best for curses-type interactions), but when you set it to nil it keeps your current scrolling position while typing as long as the prompt is still visible in the window.
It also works with `term-scroll-show-maximum-output` to handle cases where output is printed below the prompt (ala zsh).
This patch is against trunk.
-Ryan
*** term.el.orig Mon Oct 28 21:53:50 2013
--- term.el Mon Oct 28 21:53:05 2013
*************** This variable is buffer-local."
*** 551,556 ****
--- 551,564 ----
:type 'boolean
:group 'term)
+ (defcustom term-scroll-snap-to-bottom t
+ "If t, when the prompt is visible within the buffer then scroll
+ so that the prompt is on the bottom on any input or output.
+
+ The default is t."
+ :type 'boolean
+ :group 'term)
+
(defcustom term-scroll-show-maximum-output nil
"Controls how interpreter output causes window to scroll.
If non-nil, then show the maximum output when the window is scrolled.
*************** See `term-prompt-regexp'."
*** 3114,3128 ****
(or (eq scroll 'this) (not save-point)))
(and (eq scroll 'others)
(not (eq selected win))))
! (goto-char term-home-marker)
! (recenter 0)
(goto-char (process-mark proc))
(if (not (pos-visible-in-window-p (point) win))
(recenter -1)))
;; Optionally scroll so that the text
;; ends at the bottom of the window.
(when (and term-scroll-show-maximum-output
! (>= (point) (process-mark proc)))
(save-excursion
(goto-char (point-max))
(recenter -1)))))
--- 3122,3139 ----
(or (eq scroll 'this) (not save-point)))
(and (eq scroll 'others)
(not (eq selected win))))
! (when term-scroll-snap-to-bottom
! (goto-char term-home-marker)
! (recenter 0))
(goto-char (process-mark proc))
(if (not (pos-visible-in-window-p (point) win))
(recenter -1)))
;; Optionally scroll so that the text
;; ends at the bottom of the window.
(when (and term-scroll-show-maximum-output
! (>= (point) (process-mark proc))
! (or term-scroll-snap-to-bottom
! (not (pos-visible-in-window-p (point-max) win))))
(save-excursion
(goto-char (point-max))
(recenter -1)))))
This bug report was last modified 4 years and 285 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.