diff options
| author | Vibhav Pant | 2020-08-21 14:04:35 +0530 |
|---|---|---|
| committer | Vibhav Pant | 2020-08-21 14:04:35 +0530 |
| commit | f0f8d7b82492e741950c363a03b886965c91b1b0 (patch) | |
| tree | 19b716830b1ebabc0d7d75949c4e6800c0f104ad /lisp/term.el | |
| parent | 9e64a087c4d167e7ec1c4e22bea3e6af53b563de (diff) | |
| parent | c818c29771d3cb51875643b2f6c894073e429dd2 (diff) | |
| download | emacs-feature/native-comp-macos-fixes.tar.gz emacs-feature/native-comp-macos-fixes.zip | |
Merge branch 'feature/native-comp' into feature/native-comp-macos-fixesfeature/native-comp-macos-fixes
Diffstat (limited to 'lisp/term.el')
| -rw-r--r-- | lisp/term.el | 32 |
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. | ||
| 511 | If non-nil, when the prompt is visible within the window, then | ||
| 512 | scroll so that the prompt is on the bottom on any input or | ||
| 513 | output." | ||
| 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. |
| 506 | If non-nil, then show the maximum output when the window is scrolled. | 519 | If 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))))) |