aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/term.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/term.el')
-rw-r--r--lisp/term.el32
1 files changed, 26 insertions, 6 deletions
diff --git a/lisp/term.el b/lisp/term.el
index b990c83cfcb..99f1bf4f54f 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -467,6 +467,11 @@ Customize this option to nil if you want the previous behavior."
467 :type 'boolean 467 :type 'boolean
468 :group 'term) 468 :group 'term)
469 469
470(defcustom term-set-terminal-size nil
471 "If non-nil, set the LINES and COLUMNS environment variables."
472 :type 'boolean
473 :version "28.1")
474
470(defcustom term-char-mode-point-at-process-mark t 475(defcustom term-char-mode-point-at-process-mark t
471 "If non-nil, keep point at the process mark in char mode. 476 "If non-nil, keep point at the process mark in char mode.
472 477
@@ -501,6 +506,14 @@ This variable is buffer-local."
501 :type 'boolean 506 :type 'boolean
502 :group 'term) 507 :group 'term)
503 508
509(defcustom term-scroll-snap-to-bottom t
510 "Control whether to keep the prompt at the bottom of the window.
511If non-nil, when the prompt is visible within the window, then
512scroll so that the prompt is on the bottom on any input or
513output."
514 :version "28.1"
515 :type 'boolean)
516
504(defcustom term-scroll-show-maximum-output nil 517(defcustom term-scroll-show-maximum-output nil
505 "Controls how interpreter output causes window to scroll. 518 "Controls how interpreter output causes window to scroll.
506If non-nil, then show the maximum output when the window is scrolled. 519If non-nil, then show the maximum output when the window is scrolled.
@@ -1543,9 +1556,12 @@ Nil if unknown.")
1543 (format term-termcap-format "TERMCAP=" 1556 (format term-termcap-format "TERMCAP="
1544 term-term-name term-height term-width) 1557 term-term-name term-height term-width)
1545 1558
1546 (format "INSIDE_EMACS=%s,term:%s" emacs-version term-protocol-version) 1559 (format "INSIDE_EMACS=%s,term:%s"
1547 (format "LINES=%d" term-height) 1560 emacs-version term-protocol-version))
1548 (format "COLUMNS=%d" term-width)) 1561 (when term-set-terminal-size
1562 (list
1563 (format "LINES=%d" term-height)
1564 (format "COLUMNS=%d" term-width)))
1549 process-environment)) 1565 process-environment))
1550 (process-connection-type t) 1566 (process-connection-type t)
1551 ;; We should suppress conversion of end-of-line format. 1567 ;; We should suppress conversion of end-of-line format.
@@ -3108,15 +3124,19 @@ See `term-prompt-regexp'."
3108 (or (eq scroll 'this) (not save-point))) 3124 (or (eq scroll 'this) (not save-point)))
3109 (and (eq scroll 'others) 3125 (and (eq scroll 'others)
3110 (not (eq selected win)))) 3126 (not (eq selected win))))
3111 (goto-char term-home-marker) 3127 (when term-scroll-snap-to-bottom
3112 (recenter 0) 3128 (goto-char term-home-marker)
3129 (recenter 0))
3113 (goto-char (process-mark proc)) 3130 (goto-char (process-mark proc))
3114 (if (not (pos-visible-in-window-p (point) win)) 3131 (if (not (pos-visible-in-window-p (point) win))
3115 (recenter -1))) 3132 (recenter -1)))
3116 ;; Optionally scroll so that the text 3133 ;; Optionally scroll so that the text
3117 ;; ends at the bottom of the window. 3134 ;; ends at the bottom of the window.
3118 (when (and term-scroll-show-maximum-output 3135 (when (and term-scroll-show-maximum-output
3119 (>= (point) (process-mark proc))) 3136 (>= (point) (process-mark proc))
3137 (or term-scroll-snap-to-bottom
3138 (not (pos-visible-in-window-p
3139 (point-max) win))))
3120 (save-excursion 3140 (save-excursion
3121 (goto-char (point-max)) 3141 (goto-char (point-max))
3122 (recenter -1))))) 3142 (recenter -1)))))