emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 1e71026: Add new variable term-set-terminal-size (not setting LIN


From: Lars Ingebrigtsen
Subject: master 1e71026: Add new variable term-set-terminal-size (not setting LINES/COLUMNS)
Date: Sat, 15 Aug 2020 08:35:25 -0400 (EDT)

branch: master
commit 1e7102640b8df5a5a94147c5a490c6cf69d605f9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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
    <matthew@mattleach.net>.
---
 etc/NEWS     | 22 ++++++++++++++++------
 lisp/term.el | 14 +++++++++++---
 2 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index b9063aa..1a7f18d 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 149405f..99f1bf4 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]