From: Lars Ingebrigtsen Date: Sat, 15 Aug 2020 12:35:16 +0000 (+0200) Subject: Add new variable term-set-terminal-size (not setting LINES/COLUMNS) X-Git-Tag: emacs-28.0.90~6584^2~14 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1e7102640b8df5a5a94147c5a490c6cf69d605f9;p=emacs.git Add new variable term-set-terminal-size (not setting LINES/COLUMNS) * lisp/term.el (term-set-terminal-size): New variable (bug#37564). (term-exec-1): Use it. Based on a patch from Matthew Leach . --- diff --git a/etc/NEWS b/etc/NEWS index b9063aac906..1a7f18d66ef 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -797,6 +797,22 @@ work more traditionally, with 'C-d' deleting the next character. Likewise, point isn't moved to the end of the string before inserting digits. +** term-mode + +--- +*** New user option 'term-scroll-snap-to-bottom'. +By default, 'term' and 'ansi-term' will now recenter the buffer so +that the prompt is on the final line in the window. Setting this new +user option to nil inhibits this behavior. + +--- +*** New user option 'term-set-terminal-size' +If non-nil, the LINES and COLUMNS environment variables will be set +based on the current window size. In previous versions of Emacs, this +was always done (and that could lead to odd displays when resizing the +window after starting). This variable defaults to nil. + + ** Miscellaneous --- @@ -822,12 +838,6 @@ Previously, choosing a different completion with commands like 'C-.' and then hitting RET would choose the default completion. Doing this will now choose the completion under point instead. ---- -*** New user option 'term-scroll-snap-to-bottom'. -By default, 'term' and 'ansi-term' will now recenter the buffer so -that the prompt is on the final line in the window. Setting this new -user option to nil inhibits this behavior. - *** The new library hierarchy.el has been added. It's a library to create, query, navigate and display hierarchy structures. diff --git a/lisp/term.el b/lisp/term.el index 149405fa413..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." :type 'boolean :group 'term) +(defcustom term-set-terminal-size nil + "If non-nil, set the LINES and COLUMNS environment variables." + :type 'boolean + :version "28.1") + (defcustom term-char-mode-point-at-process-mark t "If non-nil, keep point at the process mark in char mode. @@ -1551,9 +1556,12 @@ Nil if unknown.") (format term-termcap-format "TERMCAP=" term-term-name term-height term-width) - (format "INSIDE_EMACS=%s,term:%s" emacs-version term-protocol-version) - (format "LINES=%d" term-height) - (format "COLUMNS=%d" term-width)) + (format "INSIDE_EMACS=%s,term:%s" + emacs-version term-protocol-version)) + (when term-set-terminal-size + (list + (format "LINES=%d" term-height) + (format "COLUMNS=%d" term-width))) process-environment)) (process-connection-type t) ;; We should suppress conversion of end-of-line format.