GNU logs - #37564, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Matthew Leach <matthew@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 30 Sep 2019 20:00:02 +0000
Resent-Message-ID: <handler.37564.B.156987355817496 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 37564 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.156987355817496
          (code B ref -1); Mon, 30 Sep 2019 20:00:02 +0000
Received: (at submit) by debbugs.gnu.org; 30 Sep 2019 19:59:18 +0000
Received: from localhost ([127.0.0.1]:60535 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iF1pF-0004Y7-QE
	for submit <at> debbugs.gnu.org; Mon, 30 Sep 2019 15:59:18 -0400
Received: from lists.gnu.org ([209.51.188.17]:42093)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <matthew@HIDDEN>) id 1iF1pE-0004Xy-8Q
 for submit <at> debbugs.gnu.org; Mon, 30 Sep 2019 15:59:16 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42086)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <matthew@HIDDEN>) id 1iF1pC-0004zR-R4
 for bug-gnu-emacs@HIDDEN; Mon, 30 Sep 2019 15:59:16 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <matthew@HIDDEN>) id 1iF1pA-0001ms-Df
 for bug-gnu-emacs@HIDDEN; Mon, 30 Sep 2019 15:59:13 -0400
Received: from mx0.mattleach.net ([176.58.118.143]:60130)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <matthew@HIDDEN>) id 1iF1pA-0001lL-5p
 for bug-gnu-emacs@HIDDEN; Mon, 30 Sep 2019 15:59:12 -0400
Received: by mx0.mattleach.net (Postfix, from userid 99)
 id 97FCE61C5D; Mon, 30 Sep 2019 20:59:07 +0100 (BST)
Received: from hopton.mattleach.net (92.40.249.172.threembb.co.uk
 [92.40.249.172])
 by mx0.mattleach.net (Postfix) with ESMTPSA id 3111961C21
 for <bug-gnu-emacs@HIDDEN>; Mon, 30 Sep 2019 20:59:06 +0100 (BST)
From: Matthew Leach <matthew@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
Date: Mon, 30 Sep 2019 20:59:04 +0100
Message-ID: <87y2y5lfnb.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-Received-From: 176.58.118.143
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain

Hi all,

The attached patch removes the exporting of the LINES and COLUMNS
environment variables in term-mode.  Exporting these variables causes
issues for ncurses applications.  For example, when running:

emacs -Q
M-x term
<ret> (to select /bin/bash)
htop (to run htop)

and resizing the window (especially making it smaller) can make the
program impossible to read.

The ncurses code uses an ioctl() initially to get the current size[1]
which returns a correct result. However, since we exported the above
environment variables these values are discarded in favour of the (now
stale) values of LINES and COLUMNS. Emacs makes no attempt to update
these variables when the window is resized. Therefore, ncurses assumes
the window size is the same when it has actually changed.

Note that executing:

$ echo $LINES

from a bash shell actually doesn't get the LINES environment variable as
can be seen with:

$ printenv | grep LINES

Whenever $LINES is accessed, bash translates this into an ioctl() and
returns the result. Therefore, removing these variables shouldn't
prevent any shell scripts from accessing these variables.

[1]: ncurses/ncurses/tinfo/lib_setup.c (_nc_get_screensize)


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-don-t-export-LINES-and-COLUMNS-env-vars-to-term.patch

From 20b1adff1c32cfeeba1cf3101b05d5c76037206d Mon Sep 17 00:00:00 2001
From: Matthew Leach <matthew@HIDDEN>
Date: Mon, 30 Sep 2019 20:35:54 +0100
Subject: [PATCH] don't export LINES and COLUMNS env vars to term

* lisp/term.el (term-exec-1): Remove the exporting of the LINES and
COLUMNS environment variables to the terminal process.
---
 lisp/term.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/term.el b/lisp/term.el
index 66ae470239a..e309bd802d5 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -1550,9 +1550,7 @@ term-exec-1
 	   (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))
 	  process-environment))
 	(process-connection-type t)
 	;; We should suppress conversion of end-of-line format.
-- 
2.23.0


--=-=-=
Content-Type: text/plain

-- 
Matt

--=-=-=--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Matthew Leach <matthew@HIDDEN>
Subject: bug#37564: Acknowledgement ([PATCH] don't export LINES and
 COLUMNS env vars in term to fix ncurses applications)
Message-ID: <handler.37564.B.156987355817496.ack <at> debbugs.gnu.org>
References: <87y2y5lfnb.fsf@HIDDEN>
X-Gnu-PR-Message: ack 37564
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Reply-To: 37564 <at> debbugs.gnu.org
Date: Mon, 30 Sep 2019 20:00:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 37564 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
37564: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D37564
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 01 Oct 2019 06:02:01 +0000
Resent-Message-ID: <handler.37564.B37564.156990967511973 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Matthew Leach <matthew@HIDDEN>
Cc: 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.156990967511973
          (code B ref 37564); Tue, 01 Oct 2019 06:02:01 +0000
Received: (at 37564) by debbugs.gnu.org; 1 Oct 2019 06:01:15 +0000
Received: from localhost ([127.0.0.1]:60789 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iFBDm-000372-Mp
	for submit <at> debbugs.gnu.org; Tue, 01 Oct 2019 02:01:15 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33224)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iFBDk-00036q-U3
 for 37564 <at> debbugs.gnu.org; Tue, 01 Oct 2019 02:01:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:55042)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iFBDf-0000RR-GQ; Tue, 01 Oct 2019 02:01:07 -0400
Received: from [176.228.60.248] (port=3778 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iFBDe-0003BH-4a; Tue, 01 Oct 2019 02:01:07 -0400
Date: Tue, 01 Oct 2019 09:01:04 +0300
Message-Id: <83eezxatsv.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <87y2y5lfnb.fsf@HIDDEN> (message from Matthew Leach on Mon, 30
 Sep 2019 20:59:04 +0100)
References: <87y2y5lfnb.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Matthew Leach <matthew@HIDDEN>
> Date: Mon, 30 Sep 2019 20:59:04 +0100
> 
> The attached patch removes the exporting of the LINES and COLUMNS
> environment variables in term-mode.  Exporting these variables causes
> issues for ncurses applications.  For example, when running:
> 
> emacs -Q
> M-x term
> <ret> (to select /bin/bash)
> htop (to run htop)
> 
> and resizing the window (especially making it smaller) can make the
> program impossible to read.

Thanks, but I don't think we can make this change unconditionally,
because not all applications that heed LINES and COLUMNS use ncurses.
I wonder if we can do better than just providing a defcustom.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Matthew Leach <matthew@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 01 Oct 2019 15:48:01 +0000
Resent-Message-ID: <handler.37564.B37564.15699448629358 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.15699448629358
          (code B ref 37564); Tue, 01 Oct 2019 15:48:01 +0000
Received: (at 37564) by debbugs.gnu.org; 1 Oct 2019 15:47:42 +0000
Received: from localhost ([127.0.0.1]:34461 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iFKNK-0002Qs-3G
	for submit <at> debbugs.gnu.org; Tue, 01 Oct 2019 11:47:42 -0400
Received: from mx0.mattleach.net ([176.58.118.143]:51342)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <matthew@HIDDEN>) id 1iFKNH-0002Qj-Gw
 for 37564 <at> debbugs.gnu.org; Tue, 01 Oct 2019 11:47:41 -0400
Received: by mx0.mattleach.net (Postfix, from userid 99)
 id 66D8661C5D; Tue,  1 Oct 2019 16:47:38 +0100 (BST)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mx0.mattleach.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED,URIBL_BLOCKED
 autolearn=disabled version=3.4.2
Received: from hopton.mattleach.net (92.40.249.172.threembb.co.uk
 [92.40.249.172])
 by mx0.mattleach.net (Postfix) with ESMTPSA id 98DAB61C21;
 Tue,  1 Oct 2019 16:47:37 +0100 (BST)
From: Matthew Leach <matthew@HIDDEN>
In-Reply-To: <83eezxatsv.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 01 Oct
 2019 09:01:04 +0300")
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
Date: Tue, 01 Oct 2019 16:47:35 +0100
Message-ID: <87tv8slb6w.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Matthew Leach <matthew@HIDDEN>
>> Date: Mon, 30 Sep 2019 20:59:04 +0100
>> 
>> The attached patch removes the exporting of the LINES and COLUMNS
>> environment variables in term-mode.  Exporting these variables causes
>> issues for ncurses applications.  For example, when running:
>> 
>> emacs -Q
>> M-x term
>> <ret> (to select /bin/bash)
>> htop (to run htop)
>> 
>> and resizing the window (especially making it smaller) can make the
>> program impossible to read.
>
> Thanks, but I don't think we can make this change unconditionally,
> because not all applications that heed LINES and COLUMNS use ncurses.

I'm curious as to which programs you are referring? AFAIK, if a program
tries to read the LINES and COLUMNS environment variables, using
`getenv()', they don't exist. Running 'echo $LINES' on a bash terminal
seems to actually do an ioctl to obtain the value of LINES.

Nevertheless, if a program does read the LINES and COLUMNS variables,
these values will be wrong if the window has been resized (try and
compile the attached C snippet and run in term mode while resizing the
window). Should that be considered as a separate bug?

> I wonder if we can do better than just providing a defcustom.

I could make this a defcustom if that would get the patch in?

Thanks,
-- 
Matt

--=-=-=
Content-Type: text/plain
Content-Disposition: inline; filename=winch2.c

#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/ioctl.h>

void handle_sig()
{
    struct winsize w;
    ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);

    printf("getenv: %s %s\n", getenv("LINES"), getenv("COLUMNS"));
    printf("ioctl:  %d %d\n", w.ws_row, w.ws_col);
}

int main()
{
    signal(SIGWINCH, handle_sig);
    fgetc(stdin);
    return 0;
}

--=-=-=--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 01 Oct 2019 16:08:02 +0000
Resent-Message-ID: <handler.37564.B37564.156994605919709 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Matthew Leach <matthew@HIDDEN>
Cc: 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.156994605919709
          (code B ref 37564); Tue, 01 Oct 2019 16:08:02 +0000
Received: (at 37564) by debbugs.gnu.org; 1 Oct 2019 16:07:39 +0000
Received: from localhost ([127.0.0.1]:34555 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iFKgd-00057p-6O
	for submit <at> debbugs.gnu.org; Tue, 01 Oct 2019 12:07:39 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43416)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iFKgb-00057c-0m
 for 37564 <at> debbugs.gnu.org; Tue, 01 Oct 2019 12:07:37 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35729)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iFKgV-0006ft-5s; Tue, 01 Oct 2019 12:07:31 -0400
Received: from [176.228.60.248] (port=1401 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iFKgU-0006f1-H5; Tue, 01 Oct 2019 12:07:31 -0400
Date: Tue, 01 Oct 2019 19:07:30 +0300
Message-Id: <83a7aka1q5.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <87tv8slb6w.fsf@HIDDEN> (message from Matthew Leach on
 Tue, 01 Oct 2019 16:47:35 +0100)
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Matthew Leach <matthew@HIDDEN>
> Cc: 37564 <at> debbugs.gnu.org
> Date: Tue, 01 Oct 2019 16:47:35 +0100
> 
> > Thanks, but I don't think we can make this change unconditionally,
> > because not all applications that heed LINES and COLUMNS use ncurses.
> 
> I'm curious as to which programs you are referring? AFAIK, if a program
> tries to read the LINES and COLUMNS environment variables, using
> `getenv()', they don't exist.

What makes you say that?  Emacs exports these variables into the
environment that is passed to child subprocesses, so those
subprocesses will definitely see them using getenv.

> Nevertheless, if a program does read the LINES and COLUMNS variables,
> these values will be wrong if the window has been resized (try and
> compile the attached C snippet and run in term mode while resizing the
> window). Should that be considered as a separate bug?

We nowadays have window-adjust-process-window-size-function to support
that, and term.el is using that.  So why isn't it working for you?
Maybe you are running a version of Emacs that's too old (AFAICT, you
didn't say which one)?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Matthew Leach <matthew@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 01 Oct 2019 18:34:01 +0000
Resent-Message-ID: <handler.37564.B37564.15699548219084 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.15699548219084
          (code B ref 37564); Tue, 01 Oct 2019 18:34:01 +0000
Received: (at 37564) by debbugs.gnu.org; 1 Oct 2019 18:33:41 +0000
Received: from localhost ([127.0.0.1]:34749 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iFMxx-0002MS-0n
	for submit <at> debbugs.gnu.org; Tue, 01 Oct 2019 14:33:41 -0400
Received: from mx0.mattleach.net ([176.58.118.143]:52748)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <matthew@HIDDEN>) id 1iFMxu-0002MJ-Bw
 for 37564 <at> debbugs.gnu.org; Tue, 01 Oct 2019 14:33:39 -0400
Received: by mx0.mattleach.net (Postfix, from userid 99)
 id 6C2C161C5D; Tue,  1 Oct 2019 19:33:37 +0100 (BST)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mx0.mattleach.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED,URIBL_BLOCKED
 autolearn=disabled version=3.4.2
Received: from hopton.mattleach.net (92.40.249.172.threembb.co.uk
 [92.40.249.172])
 by mx0.mattleach.net (Postfix) with ESMTPSA id 8F4CD61C21;
 Tue,  1 Oct 2019 19:33:36 +0100 (BST)
From: Matthew Leach <matthew@HIDDEN>
In-Reply-To: <83a7aka1q5.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 01 Oct
 2019 19:07:30 +0300")
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
Date: Tue, 01 Oct 2019 19:33:39 +0100
Message-ID: <87sgocfh8c.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Matthew Leach <matthew@HIDDEN>
>> Cc: 37564 <at> debbugs.gnu.org
>> Date: Tue, 01 Oct 2019 16:47:35 +0100
>> 
>> > Thanks, but I don't think we can make this change unconditionally,
>> > because not all applications that heed LINES and COLUMNS use ncurses.
>> 
>> I'm curious as to which programs you are referring? AFAIK, if a program
>> tries to read the LINES and COLUMNS environment variables, using
>> `getenv()', they don't exist.
>
> What makes you say that? 

If I run the C program in my previous post in an xterm and resize I get:

getenv: (null) (null)
ioctl:  24 80
getenv: (null) (null)
ioctl:  42 169

You can see that doing getenv() on LINES and COLUMNS returns a null
pointer.  I've tested this same behaviour on gnome-terminal and numerous
other terminal emulators.

> Emacs exports these variables into the environment that is passed to
> child subprocesses, so those subprocesses will definitely see them
> using getenv.

I'm no expert on how these things work but it doesn't appear to be the
way that it's done, on my machine anyway.  Perhaps there are programs
that uses these variables on MacOS or Windows?

>> Nevertheless, if a program does read the LINES and COLUMNS variables,
>> these values will be wrong if the window has been resized (try and
>> compile the attached C snippet and run in term mode while resizing the
>> window). Should that be considered as a separate bug?
>
> We nowadays have window-adjust-process-window-size-function to support
> that, and term.el is using that.  So why isn't it working for you?
> Maybe you are running a version of Emacs that's too old (AFAICT, you
> didn't say which one)?

I'm testing this on the latest Emacs Git version. I can see that
window-adjust-process-window-size-function is used in term.el however,
this doesn't appear to update the environment variables exported to the
terminal process. If I run the same program with term on Emacs git and
resize I get:

getenv: 31 80
ioctl:  30 89
getenv: 31 80
ioctl:  30 90
getenv: 31 80
ioctl:  30 91
getenv: 31 80
ioctl:  31 92
getenv: 31 80
ioctl:  31 93
getenv: 31 80
ioctl:  31 94
...

Notice that the values returned by getenv don't change.

Given that this functionality is broken, I'm suggesting that we don't
export the variables. This will make ncurses fall back to using ioctls
for window size inspection. Another way to fix this would be to somehow
update the environment variables that are exported to the process. What
are your thoughts?

Thanks,
-- 
Matt




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 01 Oct 2019 18:59:02 +0000
Resent-Message-ID: <handler.37564.B37564.156995633711590 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Matthew Leach <matthew@HIDDEN>
Cc: 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.156995633711590
          (code B ref 37564); Tue, 01 Oct 2019 18:59:02 +0000
Received: (at 37564) by debbugs.gnu.org; 1 Oct 2019 18:58:57 +0000
Received: from localhost ([127.0.0.1]:34769 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iFNMO-00030s-La
	for submit <at> debbugs.gnu.org; Tue, 01 Oct 2019 14:58:56 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35301)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iFNML-00030c-Ni
 for 37564 <at> debbugs.gnu.org; Tue, 01 Oct 2019 14:58:55 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38984)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iFNMG-0005Tk-9H; Tue, 01 Oct 2019 14:58:48 -0400
Received: from [176.228.60.248] (port=3833 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iFNMD-0004ng-0M; Tue, 01 Oct 2019 14:58:47 -0400
Date: Tue, 01 Oct 2019 21:58:25 +0300
Message-Id: <83y2y48f8u.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <87sgocfh8c.fsf@HIDDEN> (message from Matthew Leach on
 Tue, 01 Oct 2019 19:33:39 +0100)
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Matthew Leach <matthew@HIDDEN>
> Cc: 37564 <at> debbugs.gnu.org
> Date: Tue, 01 Oct 2019 19:33:39 +0100
> 
> >> I'm curious as to which programs you are referring? AFAIK, if a program
> >> tries to read the LINES and COLUMNS environment variables, using
> >> `getenv()', they don't exist.
> >
> > What makes you say that? 
> 
> If I run the C program in my previous post in an xterm and resize I get:
> 
> getenv: (null) (null)
> ioctl:  24 80
> getenv: (null) (null)
> ioctl:  42 169
> 
> You can see that doing getenv() on LINES and COLUMNS returns a null
> pointer.  I've tested this same behaviour on gnome-terminal and numerous
> other terminal emulators.

I simply tried "env | fgrep LINES" and I do see the variable, although
it wasn't there before I launched Emacs.  'env' is just another
program accessing the environment, right?  I have no idea why your
test program doesn't see that, but then I'm far from being an expert
on these issues.

> > Emacs exports these variables into the environment that is passed to
> > child subprocesses, so those subprocesses will definitely see them
> > using getenv.
> 
> I'm no expert on how these things work but it doesn't appear to be the
> way that it's done, on my machine anyway.  Perhaps there are programs
> that uses these variables on MacOS or Windows?

I tried the above on a Trisquel GNU/Windows machine, FWIW.

> I'm testing this on the latest Emacs Git version. I can see that
> window-adjust-process-window-size-function is used in term.el however,
> this doesn't appear to update the environment variables exported to the
> terminal process.

AFAIR, it's supposed to send the corresponding ioctl command, in
addition to setting LINES and COLUMNS.

> If I run the same program with term on Emacs git and
> resize I get:
> 
> getenv: 31 80
> ioctl:  30 89
> getenv: 31 80
> ioctl:  30 90
> getenv: 31 80
> ioctl:  30 91
> getenv: 31 80
> ioctl:  31 92
> getenv: 31 80
> ioctl:  31 93
> getenv: 31 80
> ioctl:  31 94
> ...
> 
> Notice that the values returned by getenv don't change.

Again, the "env | fgrep LINES" method does show the change when I
resize the window on the machine I tried this, so I'm unsure why you
don't see it.

> Given that this functionality is broken, I'm suggesting that we don't
> export the variables.

I don't agree that it's broken; it isn't for me.  I think someone who
understands more than I do about this stuff should chime in and
explain why we see such different results.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 01 Oct 2019 19:16:02 +0000
Resent-Message-ID: <handler.37564.B37564.156995731314088 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: matthew@HIDDEN
Cc: 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.156995731314088
          (code B ref 37564); Tue, 01 Oct 2019 19:16:02 +0000
Received: (at 37564) by debbugs.gnu.org; 1 Oct 2019 19:15:13 +0000
Received: from localhost ([127.0.0.1]:34792 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iFNc9-0003en-DE
	for submit <at> debbugs.gnu.org; Tue, 01 Oct 2019 15:15:13 -0400
Received: from eggs.gnu.org ([209.51.188.92]:37562)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iFNc7-0003Xe-RP
 for 37564 <at> debbugs.gnu.org; Tue, 01 Oct 2019 15:15:12 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39307)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iFNc2-0003B8-F8; Tue, 01 Oct 2019 15:15:06 -0400
Received: from [176.228.60.248] (port=4843 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iFNbz-00041e-6i; Tue, 01 Oct 2019 15:15:05 -0400
Date: Tue, 01 Oct 2019 22:14:38 +0300
Message-Id: <83tv8s8eht.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <83y2y48f8u.fsf@HIDDEN> (message from Eli Zaretskii on Tue, 01
 Oct 2019 21:58:25 +0300)
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 01 Oct 2019 21:58:25 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> Cc: 37564 <at> debbugs.gnu.org
> 
> I tried the above on a Trisquel GNU/Windows machine, FWIW.

I meant GNU/Linux, of course.  Sorry...




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Matthew Leach <matthew@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 01 Oct 2019 19:25:01 +0000
Resent-Message-ID: <handler.37564.B37564.156995785722163 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.156995785722163
          (code B ref 37564); Tue, 01 Oct 2019 19:25:01 +0000
Received: (at 37564) by debbugs.gnu.org; 1 Oct 2019 19:24:17 +0000
Received: from localhost ([127.0.0.1]:34816 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iFNku-0005lP-Gr
	for submit <at> debbugs.gnu.org; Tue, 01 Oct 2019 15:24:16 -0400
Received: from mx0.mattleach.net ([176.58.118.143]:53080)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <matthew@HIDDEN>) id 1iFNkr-0005lD-KF
 for 37564 <at> debbugs.gnu.org; Tue, 01 Oct 2019 15:24:15 -0400
Received: by mx0.mattleach.net (Postfix, from userid 99)
 id 91D9961C91; Tue,  1 Oct 2019 20:24:12 +0100 (BST)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mx0.mattleach.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED,URIBL_BLOCKED
 autolearn=disabled version=3.4.2
Received: from hopton.mattleach.net (92.40.249.172.threembb.co.uk
 [92.40.249.172])
 by mx0.mattleach.net (Postfix) with ESMTPSA id A292461C21;
 Tue,  1 Oct 2019 20:24:11 +0100 (BST)
From: Matthew Leach <matthew@HIDDEN>
In-Reply-To: <83y2y48f8u.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 01 Oct
 2019 21:58:25 +0300")
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
Date: Tue, 01 Oct 2019 20:24:14 +0100
Message-ID: <87o8z0few1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Matthew Leach <matthew@HIDDEN>
>> Cc: 37564 <at> debbugs.gnu.org
>> Date: Tue, 01 Oct 2019 19:33:39 +0100
>> 
>> >> I'm curious as to which programs you are referring? AFAIK, if a program
>> >> tries to read the LINES and COLUMNS environment variables, using
>> >> `getenv()', they don't exist.
>> >
>> > What makes you say that? 
>> 
>> If I run the C program in my previous post in an xterm and resize I get:
>> 
>> getenv: (null) (null)
>> ioctl:  24 80
>> getenv: (null) (null)
>> ioctl:  42 169
>> 
>> You can see that doing getenv() on LINES and COLUMNS returns a null
>> pointer.  I've tested this same behaviour on gnome-terminal and numerous
>> other terminal emulators.
>
> I simply tried "env | fgrep LINES" and I do see the variable, although
> it wasn't there before I launched Emacs.

I would expect the variable to be there when inside Emacs as it has
exported it.  You should find that it won't exist if ran outside Emacs,
for example in xterm.

> 'env' is just another program accessing the environment, right? I have
> no idea why your test program doesn't see that, but then I'm far from
> being an expert on these issues.

Indeed, it does see the variables if I run inside Emacs.  If I run it
outside then they are not there, on my machine anyway.

>> > Emacs exports these variables into the environment that is passed to
>> > child subprocesses, so those subprocesses will definitely see them
>> > using getenv.
>> 
>> I'm no expert on how these things work but it doesn't appear to be the
>> way that it's done, on my machine anyway.  Perhaps there are programs
>> that uses these variables on MacOS or Windows?
>
> I tried the above on a Trisquel GNU/Windows machine, FWIW.

I'm running on Arch GNU/Linux this end.

>> I'm testing this on the latest Emacs Git version. I can see that
>> window-adjust-process-window-size-function is used in term.el however,
>> this doesn't appear to update the environment variables exported to the
>> terminal process.
>
> AFAIR, it's supposed to send the corresponding ioctl command, in
> addition to setting LINES and COLUMNS.
>
>> If I run the same program with term on Emacs git and
>> resize I get:
>> 
>> getenv: 31 80
>> ioctl:  30 89
>> getenv: 31 80
>> ioctl:  30 90
>> getenv: 31 80
>> ioctl:  30 91
>> getenv: 31 80
>> ioctl:  31 92
>> getenv: 31 80
>> ioctl:  31 93
>> getenv: 31 80
>> ioctl:  31 94
>> ...
>> 
>> Notice that the values returned by getenv don't change.
>
> Again, the "env | fgrep LINES" method does show the change when I
> resize the window on the machine I tried this, so I'm unsure why you
> don't see it.

Ah, indeed if I try and resize and print the variable it has updated:

matthew@hopton ~ $ env | grep -i lines
LINES=30
matthew@hopton ~ $ env | grep -i lines
LINES=12

I think the issue is that the environment can't be while a process is
running; the environment variables are fixed when the program has
started. For a ncurses application this presents a problem as LINES and
COLUMNS can't be updated when the window size is changed and the program
handles a SIGWINCH. You can see that on the output above.

>> Given that this functionality is broken, I'm suggesting that we don't
>> export the variables.
>
> I don't agree that it's broken; it isn't for me.  I think someone who
> understands more than I do about this stuff should chime in and
> explain why we see such different results.

I think the above explains what's going on. Perhaps that's why terminal
emulators don't export LINES and COLUMNS to programs so an ioctl() is used
instead?
-- 
Matt




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 02 Oct 2019 02:29:01 +0000
Resent-Message-ID: <handler.37564.B37564.156998331824440 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Matthew Leach <matthew@HIDDEN>
Cc: 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.156998331824440
          (code B ref 37564); Wed, 02 Oct 2019 02:29:01 +0000
Received: (at 37564) by debbugs.gnu.org; 2 Oct 2019 02:28:38 +0000
Received: from localhost ([127.0.0.1]:35266 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iFUNa-0006M8-BQ
	for submit <at> debbugs.gnu.org; Tue, 01 Oct 2019 22:28:38 -0400
Received: from eggs.gnu.org ([209.51.188.92]:32851)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iFUNX-0006Lu-Jq
 for 37564 <at> debbugs.gnu.org; Tue, 01 Oct 2019 22:28:37 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:46504)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iFUNQ-0001qi-U4; Tue, 01 Oct 2019 22:28:30 -0400
Received: from [176.228.60.248] (port=3350 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iFUNO-0000i0-HI; Tue, 01 Oct 2019 22:28:28 -0400
Date: Wed, 02 Oct 2019 05:28:15 +0300
Message-Id: <83sgob98zk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <87o8z0few1.fsf@HIDDEN> (message from Matthew Leach on
 Tue, 01 Oct 2019 20:24:14 +0100)
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Matthew Leach <matthew@HIDDEN>
> Cc: 37564 <at> debbugs.gnu.org
> Date: Tue, 01 Oct 2019 20:24:14 +0100
> 
> > I simply tried "env | fgrep LINES" and I do see the variable, although
> > it wasn't there before I launched Emacs.
> 
> I would expect the variable to be there when inside Emacs as it has
> exported it.  You should find that it won't exist if ran outside Emacs,
> for example in xterm.

Sorry, I'm confused.  Are we talking about running "M-x term" inside
Emacs, or are we talking about something else?  The subject of the bug
report says "term", so I assumed you mean term-mode.

> Ah, indeed if I try and resize and print the variable it has updated:
> 
> matthew@hopton ~ $ env | grep -i lines
> LINES=30
> matthew@hopton ~ $ env | grep -i lines
> LINES=12
> 
> I think the issue is that the environment can't be while a process is
> running; the environment variables are fixed when the program has
> started. For a ncurses application this presents a problem as LINES and
> COLUMNS can't be updated when the window size is changed and the program
> handles a SIGWINCH. You can see that on the output above.

While the process is running, Emacs sends ioctl commands to
communicate the window size changes.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Glenn Morris <rgm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 03 Oct 2019 17:52:02 +0000
Resent-Message-ID: <handler.37564.B37564.157012508717217 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Matthew Leach <matthew@HIDDEN>, 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157012508717217
          (code B ref 37564); Thu, 03 Oct 2019 17:52:02 +0000
Received: (at 37564) by debbugs.gnu.org; 3 Oct 2019 17:51:27 +0000
Received: from localhost ([127.0.0.1]:41098 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iG5GB-0004Td-2p
	for submit <at> debbugs.gnu.org; Thu, 03 Oct 2019 13:51:27 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56749)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rgm@HIDDEN>) id 1iG5G9-0004TQ-1O
 for 37564 <at> debbugs.gnu.org; Thu, 03 Oct 2019 13:51:25 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49564)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rgm@HIDDEN>)
 id 1iG5G3-0006yc-GD; Thu, 03 Oct 2019 13:51:19 -0400
Received: from rgm by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rgm@HIDDEN>)
 id 1iG5G1-0006jC-0o; Thu, 03 Oct 2019 13:51:17 -0400
From: Glenn Morris <rgm@HIDDEN>
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
X-Spook: Interstate 2600 dedicated denial of service Closure Foot
X-Ran: L2}yP(H|HJwj^)]I-X%OGt]r`Es`8o8ZzVMmhm#My<i3r^sjuZjDHD`)H47e8ySkjxjL'J
X-Hue: magenta
X-Attribution: GM
Date: Thu, 03 Oct 2019 13:51:16 -0400
In-Reply-To: <83sgob98zk.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 02 Oct
 2019 05:28:15 +0300")
Message-ID: <9ipnjdemzv.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -1.6 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)


I think the point is that no terminal emulator / shell combination
actually exports LINES and COLUMNS as environment variables, except for
Emacs term.el. So no application can be relying on the LINES and COLUMNS
environment variables (since there aren't any applications specifically
for use inside Emacs's term). So term.el should stop setting them, since
it actually causes problems.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Matthew Leach <matthew@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 04 Oct 2019 18:48:02 +0000
Resent-Message-ID: <handler.37564.B37564.157021486429245 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157021486429245
          (code B ref 37564); Fri, 04 Oct 2019 18:48:02 +0000
Received: (at 37564) by debbugs.gnu.org; 4 Oct 2019 18:47:44 +0000
Received: from localhost ([127.0.0.1]:43464 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGScC-0007bd-0L
	for submit <at> debbugs.gnu.org; Fri, 04 Oct 2019 14:47:44 -0400
Received: from mx0.mattleach.net ([176.58.118.143]:55348)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <matthew@HIDDEN>) id 1iGSc9-0007bT-6r
 for 37564 <at> debbugs.gnu.org; Fri, 04 Oct 2019 14:47:41 -0400
Received: by mx0.mattleach.net (Postfix, from userid 99)
 id 8AC2161C5D; Fri,  4 Oct 2019 19:47:39 +0100 (BST)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mx0.mattleach.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED
 autolearn=disabled version=3.4.2
Received: from hopton.mattleach.net (92.40.249.172.threembb.co.uk
 [92.40.249.172])
 by mx0.mattleach.net (Postfix) with ESMTPSA id A7CC361C21;
 Fri,  4 Oct 2019 19:47:38 +0100 (BST)
From: Matthew Leach <matthew@HIDDEN>
In-Reply-To: <83sgob98zk.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 02 Oct
 2019 05:28:15 +0300")
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
Date: Fri, 04 Oct 2019 19:47:41 +0100
Message-ID: <87d0fcjqk2.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

>> From: Matthew Leach <matthew@HIDDEN>
>> Cc: 37564 <at> debbugs.gnu.org
>> Date: Tue, 01 Oct 2019 20:24:14 +0100
>> 
>> > I simply tried "env | fgrep LINES" and I do see the variable, although
>> > it wasn't there before I launched Emacs.
>> 
>> I would expect the variable to be there when inside Emacs as it has
>> exported it.  You should find that it won't exist if ran outside Emacs,
>> for example in xterm.
>
> Sorry, I'm confused.  Are we talking about running "M-x term" inside
> Emacs, or are we talking about something else?  The subject of the bug
> report says "term", so I assumed you mean term-mode.

Indeed, I'm talking about term-mode (M-x term). Sorry if I didn't make
that clear.

>> Ah, indeed if I try and resize and print the variable it has updated:
>> 
>> matthew@hopton ~ $ env | grep -i lines
>> LINES=30
>> matthew@hopton ~ $ env | grep -i lines
>> LINES=12
>> 
>> I think the issue is that the environment can't be while a process is
>> running; the environment variables are fixed when the program has
>> started. For a ncurses application this presents a problem as LINES and
>> COLUMNS can't be updated when the window size is changed and the program
>> handles a SIGWINCH. You can see that on the output above.
>
> While the process is running, Emacs sends ioctl commands to
> communicate the window size changes.

Sure but by exporting LINES and COLUMNS (something that other terminal
emulators don't do) programs aren't picking up changes in the window
size.

-- 
Matt




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Matthew Leach <matthew@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 04 Oct 2019 18:49:01 +0000
Resent-Message-ID: <handler.37564.B37564.157021493029370 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Glenn Morris <rgm@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157021493029370
          (code B ref 37564); Fri, 04 Oct 2019 18:49:01 +0000
Received: (at 37564) by debbugs.gnu.org; 4 Oct 2019 18:48:50 +0000
Received: from localhost ([127.0.0.1]:43470 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iGSdG-0007de-Ck
	for submit <at> debbugs.gnu.org; Fri, 04 Oct 2019 14:48:50 -0400
Received: from mx0.mattleach.net ([176.58.118.143]:55366)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <matthew@HIDDEN>) id 1iGSdE-0007dW-Sm
 for 37564 <at> debbugs.gnu.org; Fri, 04 Oct 2019 14:48:49 -0400
Received: by mx0.mattleach.net (Postfix, from userid 99)
 id 6CD0F61C21; Fri,  4 Oct 2019 19:48:48 +0100 (BST)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mx0.mattleach.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED
 autolearn=disabled version=3.4.2
Received: from hopton.mattleach.net (92.40.249.172.threembb.co.uk
 [92.40.249.172])
 by mx0.mattleach.net (Postfix) with ESMTPSA id AC41B61C21;
 Fri,  4 Oct 2019 19:48:45 +0100 (BST)
From: Matthew Leach <matthew@HIDDEN>
In-Reply-To: <9ipnjdemzv.fsf@HIDDEN> (Glenn Morris's message of
 "Thu, 03 Oct 2019 13:51:16 -0400")
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
Date: Fri, 04 Oct 2019 19:48:49 +0100
Message-ID: <878sq0jqi6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Glenn Morris <rgm@HIDDEN> writes:

> I think the point is that no terminal emulator / shell combination
> actually exports LINES and COLUMNS as environment variables, except for
> Emacs term.el. So no application can be relying on the LINES and COLUMNS
> environment variables (since there aren't any applications specifically
> for use inside Emacs's term). So term.el should stop setting them, since
> it actually causes problems.

Exactly that.  By exporting these variables it's causing more problems
than it solves.
-- 
Matt




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 07 Oct 2019 04:12:01 +0000
Resent-Message-ID: <handler.37564.B37564.157042150115530 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Matthew Leach <matthew@HIDDEN>
Cc: Eli Zaretskii <eliz@HIDDEN>, 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157042150115530
          (code B ref 37564); Mon, 07 Oct 2019 04:12:01 +0000
Received: (at 37564) by debbugs.gnu.org; 7 Oct 2019 04:11:41 +0000
Received: from localhost ([127.0.0.1]:47155 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHKN3-00042O-AZ
	for submit <at> debbugs.gnu.org; Mon, 07 Oct 2019 00:11:41 -0400
Received: from quimby.gnus.org ([80.91.231.51]:55586)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1iHKN1-00042E-3b
 for 37564 <at> debbugs.gnu.org; Mon, 07 Oct 2019 00:11:40 -0400
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie)
 by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from <larsi@HIDDEN>)
 id 1iHKMx-0005V0-D6; Mon, 07 Oct 2019 06:11:37 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN>
Date: Mon, 07 Oct 2019 06:11:35 +0200
In-Reply-To: <87o8z0few1.fsf@HIDDEN> (Matthew Leach's message of "Tue, 
 01 Oct 2019 20:24:14 +0100")
Message-ID: <87sgo59oug.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Matthew Leach <matthew@HIDDEN> writes: >> I simply
 tried "env | fgrep LINES" and I do see the variable, although >> it wasn't
 there before I launched Emacs. > > I would expect the variable to be there
 when inside Emacs as it has > exported [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Matthew Leach <matthew@HIDDEN> writes:

>> I simply tried "env | fgrep LINES" and I do see the variable, although
>> it wasn't there before I launched Emacs.
>
> I would expect the variable to be there when inside Emacs as it has
> exported it.  You should find that it won't exist if ran outside Emacs,
> for example in xterm.

I tried this in my bash here (under the "Terminal" program in Debian):

larsi@marnie:~/src/emacs/trunk$ set | grep LINES
LINES=24
larsi@marnie:~/src/emacs/trunk$ set | grep COLUMNS
COLUMNS=80

So they're in my env at least.

But I see I have this in my very ancient ~/.bashrc:

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Andreas Schwab <schwab@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 07 Oct 2019 09:17:02 +0000
Resent-Message-ID: <handler.37564.B37564.15704397933214 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Lars Ingebrigtsen <larsi@HIDDEN>
Cc: Matthew Leach <matthew@HIDDEN>, 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.15704397933214
          (code B ref 37564); Mon, 07 Oct 2019 09:17:02 +0000
Received: (at 37564) by debbugs.gnu.org; 7 Oct 2019 09:16:33 +0000
Received: from localhost ([127.0.0.1]:47366 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHP84-0000pl-QP
	for submit <at> debbugs.gnu.org; Mon, 07 Oct 2019 05:16:33 -0400
Received: from mail-out.m-online.net ([212.18.0.9]:46747)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <whitebox@HIDDEN>) id 1iHP81-0000pb-5N
 for 37564 <at> debbugs.gnu.org; Mon, 07 Oct 2019 05:16:31 -0400
Received: from frontend01.mail.m-online.net (unknown [192.168.8.182])
 by mail-out.m-online.net (Postfix) with ESMTP id 46mvx8030Tz1rKJk;
 Mon,  7 Oct 2019 11:16:27 +0200 (CEST)
Received: from localhost (dynscan1.mnet-online.de [192.168.6.70])
 by mail.m-online.net (Postfix) with ESMTP id 46mvx75Qnmz1qqkC;
 Mon,  7 Oct 2019 11:16:27 +0200 (CEST)
X-Virus-Scanned: amavisd-new at mnet-online.de
Received: from mail.mnet-online.de ([192.168.8.182])
 by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,
 port 10024)
 with ESMTP id 4sNlZhyFVHbw; Mon,  7 Oct 2019 11:16:27 +0200 (CEST)
X-Auth-Info: TpsNO53QkHkWaC84RHJ9cJe5ljNgJdciMOFyMzNyAEqPbxcjbsV8dzKmlMr3czMW
Received: from igel.home (ppp-46-244-165-160.dynamic.mnet-online.de
 [46.244.165.160])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by mail.mnet-online.de (Postfix) with ESMTPSA;
 Mon,  7 Oct 2019 11:16:26 +0200 (CEST)
Received: by igel.home (Postfix, from userid 1000)
 id 420FB2C0181; Mon,  7 Oct 2019 11:16:26 +0200 (CEST)
From: Andreas Schwab <schwab@HIDDEN>
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <87sgo59oug.fsf@HIDDEN>
X-Yow: I'm GLAD I remembered to XEROX all my UNDERSHIRTS!!
Date: Mon, 07 Oct 2019 11:16:26 +0200
In-Reply-To: <87sgo59oug.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Mon,
 07 Oct 2019 06:11:35 +0200")
Message-ID: <878spw3ogl.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.5 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.5 (-)

On Okt 07 2019, Lars Ingebrigtsen <larsi@HIDDEN> wrote:

> I tried this in my bash here (under the "Terminal" program in Debian):
>
> larsi@marnie:~/src/emacs/trunk$ set | grep LINES
> LINES=24
> larsi@marnie:~/src/emacs/trunk$ set | grep COLUMNS
> COLUMNS=80
>
> So they're in my env at least.

`set' doesn't print the environment, it prints the shell variables.  To
print the environment, use `export -p' or `printenv'.

Andreas.

-- 
Andreas Schwab, schwab@HIDDEN
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Lars Ingebrigtsen <larsi@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 08 Oct 2019 16:39:01 +0000
Resent-Message-ID: <handler.37564.B37564.157055271927011 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Andreas Schwab <schwab@HIDDEN>
Cc: Matthew Leach <matthew@HIDDEN>, 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157055271927011
          (code B ref 37564); Tue, 08 Oct 2019 16:39:01 +0000
Received: (at 37564) by debbugs.gnu.org; 8 Oct 2019 16:38:39 +0000
Received: from localhost ([127.0.0.1]:51352 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iHsVT-00071b-0g
	for submit <at> debbugs.gnu.org; Tue, 08 Oct 2019 12:38:39 -0400
Received: from quimby.gnus.org ([80.91.231.51]:39682)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1iHsVQ-00071R-G8
 for 37564 <at> debbugs.gnu.org; Tue, 08 Oct 2019 12:38:37 -0400
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie)
 by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.89) (envelope-from <larsi@HIDDEN>)
 id 1iHsVM-0007Rw-Jp; Tue, 08 Oct 2019 18:38:35 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <87sgo59oug.fsf@HIDDEN>
 <878spw3ogl.fsf@HIDDEN>
Date: Tue, 08 Oct 2019 18:38:32 +0200
In-Reply-To: <878spw3ogl.fsf@HIDDEN> (Andreas Schwab's message of "Mon, 07
 Oct 2019 11:16:26 +0200")
Message-ID: <87muebyyyf.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Andreas Schwab <schwab@HIDDEN> writes: > `set'
 doesn't print the environment,
 it prints the shell variables. To > print the environment, 
 use `export -p' or `printenv'. I see. Yes, they are not in my environment
 when I check with printenv. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Andreas Schwab <schwab@HIDDEN> writes:

> `set' doesn't print the environment, it prints the shell variables.  To
> print the environment, use `export -p' or `printenv'.

I see.  Yes, they are not in my environment when I check with printenv.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Stefan Kangas <stefan@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 20 Jan 2020 19:12:02 +0000
Resent-Message-ID: <handler.37564.B37564.157954746227113 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Matthew Leach <matthew@HIDDEN>
Cc: Glenn Morris <rgm@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157954746227113
          (code B ref 37564); Mon, 20 Jan 2020 19:12:02 +0000
Received: (at 37564) by debbugs.gnu.org; 20 Jan 2020 19:11:02 +0000
Received: from localhost ([127.0.0.1]:46062 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1itcRx-000735-T5
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2020 14:11:02 -0500
Received: from ted.gofardesign.uk ([67.225.143.91]:36498)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan@HIDDEN>) id 1itcRt-00072e-I7
 for 37564 <at> debbugs.gnu.org; Mon, 20 Jan 2020 14:10:59 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; 
 s=default;
 h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=SpXISppEEQ0hycvsYohQ5UbmnpaSqKq3Z35AAPD8JwI=; b=FxQ8/CygNmtgVs2Crob666rGpe
 5WZlQvAAGZF0NQ8uREIiy08N/bJTjDCiE0rrq0VBTMlpHrXBytbzO6Y56nvzK3jH26XFFX61ACdRA
 1rkEzFFVqO6Ks/ji+cSYOzAt6qO4EJcPTZ/VYVkhWe0WN8KKAdPBEBmX/+JCmc0MY0iMPIGosISoF
 pm5Wqg7132gmhUu7v6nodGLoAqFZ4078jw/fmTK0aDXccbsSuj8lLrP7WZJiEDu6A42CYz51jMLwK
 qfBTHksf2IH8nWdNdO8VQLzs5rR8YQfHLqj5rj6/f21hXbOzsdilmoqmAs3g71A3iDdjjbDUfs43t
 FqYASjmA==;
Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:45242
 helo=localhost)
 by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
 (Exim 4.92) (envelope-from <stefan@HIDDEN>)
 id 1itcRm-001rAC-DJ; Mon, 20 Jan 2020 14:10:50 -0500
From: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <878sq0jqi6.fsf@HIDDEN> (Matthew Leach's message of "Fri, 
 04 Oct 2019 19:48:49 +0100")
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN> <878sq0jqi6.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Date: Mon, 20 Jan 2020 20:10:49 +0100
Message-ID: <87o8uyrlja.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - ted.gofardesign.uk
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - marxist.se
X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id:
 stefan@HIDDEN
X-Authenticated-Sender: ted.gofardesign.uk: stefan@HIDDEN
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Matthew Leach <matthew@HIDDEN> writes:

> Glenn Morris <rgm@HIDDEN> writes:
>
>> I think the point is that no terminal emulator / shell combination
>> actually exports LINES and COLUMNS as environment variables, except for
>> Emacs term.el. So no application can be relying on the LINES and COLUMNS
>> environment variables (since there aren't any applications specifically
>> for use inside Emacs's term). So term.el should stop setting them, since
>> it actually causes problems.
>
> Exactly that.  By exporting these variables it's causing more problems
> than it solves.

That sounds reasonable to me.  Should we go ahead and install the
original patch on the master branch then, or is there more to discuss?

Best regards,
Stefan Kangas




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 20 Jan 2020 19:31:01 +0000
Resent-Message-ID: <handler.37564.B37564.157954863829017 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Stefan Kangas <stefan@HIDDEN>
Cc: matthew@HIDDEN, 37564 <at> debbugs.gnu.org, rgm@HIDDEN
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157954863829017
          (code B ref 37564); Mon, 20 Jan 2020 19:31:01 +0000
Received: (at 37564) by debbugs.gnu.org; 20 Jan 2020 19:30:38 +0000
Received: from localhost ([127.0.0.1]:46075 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1itckt-0007Xu-Aq
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2020 14:30:38 -0500
Received: from eggs.gnu.org ([209.51.188.92]:55632)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1itcko-0007Xb-54
 for 37564 <at> debbugs.gnu.org; Mon, 20 Jan 2020 14:30:33 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59381)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1itcki-0001Fn-Jo; Mon, 20 Jan 2020 14:30:24 -0500
Received: from [176.228.60.248] (port=4398 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1itckf-00052l-0L; Mon, 20 Jan 2020 14:30:22 -0500
Date: Mon, 20 Jan 2020 21:30:28 +0200
Message-Id: <83pnfevsbv.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <87o8uyrlja.fsf@HIDDEN> (message from Stefan Kangas on Mon,
 20 Jan 2020 20:10:49 +0100)
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN> <878sq0jqi6.fsf@HIDDEN>
 <87o8uyrlja.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Kangas <stefan@HIDDEN>
> Cc: Glenn Morris <rgm@HIDDEN>,  Eli Zaretskii <eliz@HIDDEN>,
>   37564 <at> debbugs.gnu.org
> Date: Mon, 20 Jan 2020 20:10:49 +0100
> 
> Matthew Leach <matthew@HIDDEN> writes:
> 
> > Glenn Morris <rgm@HIDDEN> writes:
> >
> >> I think the point is that no terminal emulator / shell combination
> >> actually exports LINES and COLUMNS as environment variables, except for
> >> Emacs term.el. So no application can be relying on the LINES and COLUMNS
> >> environment variables (since there aren't any applications specifically
> >> for use inside Emacs's term). So term.el should stop setting them, since
> >> it actually causes problems.
> >
> > Exactly that.  By exporting these variables it's causing more problems
> > than it solves.
> 
> That sounds reasonable to me.  Should we go ahead and install the
> original patch on the master branch then, or is there more to discuss?

Sorry, but I need more than just assertions to convince me.  I have
yet to see an application that doesn't cater to LINES and COLUMNS.
Heck, Emacs itself does!  It is true that these variables nowadays are
mostly kept for the users, but that doesn't yet mean Emacs cannot use
them to affect the programs it runs.  As for "causing more problems
than it solves", I don't think I saw any evidence for that: even the
one use case which started this bug report was later shown to behave
as expected.  Or maybe I was just confused, in which case I'd
appreciate a clear and concise description of how these variables are
harmful for ncurses programs.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Glenn Morris <rgm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 21 Jan 2020 01:00:02 +0000
Resent-Message-ID: <handler.37564.B37564.15795683459790 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: matthew@HIDDEN, 37564 <at> debbugs.gnu.org, Stefan Kangas <stefan@HIDDEN>
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.15795683459790
          (code B ref 37564); Tue, 21 Jan 2020 01:00:02 +0000
Received: (at 37564) by debbugs.gnu.org; 21 Jan 2020 00:59:05 +0000
Received: from localhost ([127.0.0.1]:46314 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ithsm-0002Xq-VD
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2020 19:59:05 -0500
Received: from eggs.gnu.org ([209.51.188.92]:60232)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rgm@HIDDEN>) id 1ithsl-0002XF-Pb
 for 37564 <at> debbugs.gnu.org; Mon, 20 Jan 2020 19:59:04 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:35658)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rgm@HIDDEN>)
 id 1ithsg-00035C-8j; Mon, 20 Jan 2020 19:58:58 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rgm@HIDDEN>)
 id 1ithsc-0007ce-BW; Mon, 20 Jan 2020 19:58:54 -0500
From: Glenn Morris <rgm@HIDDEN>
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN> <878sq0jqi6.fsf@HIDDEN>
 <87o8uyrlja.fsf@HIDDEN> <83pnfevsbv.fsf@HIDDEN>
X-Spook: CipherTAC-2000 Mexico Agriculture enemy of the state
X-Ran: 'q~,.wQ`V#*`XGjw7K?:FhIGAKb04-qFm`g8u%O>3"=EM@:`lac,b|LFizAW?x+/QH0)S|
X-Hue: brightred
X-Attribution: GM
Date: Mon, 20 Jan 2020 19:58:53 -0500
In-Reply-To: <83pnfevsbv.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Jan
 2020 21:30:28 +0200")
Message-ID: <7nd0bd8w1e.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


The report seems clear to me.

No other terminal emulator exports LINES and COLUMNS as environment variables.
Applications use ioctl to get the size.
   -> Therefore setting LINES and COLUMNS is pointless.
If LINES/COLUMNS are set, they override ioctl.
You can't update the environment of an already running process.
Therefore the presence of LINES/COLUMNS in the initial environment
of a process spawned from Emacs means it will fail to react to resizing.
 Therefore exporting LINES and COLUMNS is harmful.
(It's irrelevant if Emacs changes LINES and COLUMNS for new processes.)

So don't export LINES and COLUMNS.

I can't explain it any better.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Stefan Kangas <stefan@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 21 Jan 2020 03:05:01 +0000
Resent-Message-ID: <handler.37564.B37564.15795758704380 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: matthew@HIDDEN, 37564 <at> debbugs.gnu.org, rgm@HIDDEN
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.15795758704380
          (code B ref 37564); Tue, 21 Jan 2020 03:05:01 +0000
Received: (at 37564) by debbugs.gnu.org; 21 Jan 2020 03:04:30 +0000
Received: from localhost ([127.0.0.1]:46354 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1itjq9-00018a-S3
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2020 22:04:30 -0500
Received: from ted.gofardesign.uk ([67.225.143.91]:46252)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan@HIDDEN>) id 1itjq8-00018O-DK
 for 37564 <at> debbugs.gnu.org; Mon, 20 Jan 2020 22:04:28 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; 
 s=default;
 h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Zyosv99KXBj/Hm4WLSYvEgJuKT6VMGjmd/BN+c0GcuQ=; b=msiPJwzXVSQ1eJN4O9bj7H+z5w
 iCgLtjmyiUkY2L22OzTUhTxthLWJi12PSe6qeohjVWj/2HowwsnyIF1ZIUsTpXfSxLgRAougZlu2k
 ZLQTPzxiN1WZN7Mcfii/9KuvEsaK1ie2TUl7hSMSVycoA18xcgQPp+oKYikyla4yKfqg4t3Fysw3e
 o/k1oauGzBX4qnjfIcdxT1LbCuiwv4dUXiEI9IaW54iuD9IZdEGI6VS53BWYIfSB8na4P+EvPp86+
 uZ8AoGvao9lSSVpZ7haPXJ3zN6U/AKGCGgqylIwugjZ3yumAlOmHeWOycV2ijoUIo72jiBV5WuGBI
 Sg/FycRA==;
Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:44952
 helo=localhost)
 by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
 (Exim 4.92) (envelope-from <stefan@HIDDEN>)
 id 1itjq0-001YPx-N9; Mon, 20 Jan 2020 22:04:20 -0500
From: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <83pnfevsbv.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 20 Jan
 2020 21:30:28 +0200")
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN> <878sq0jqi6.fsf@HIDDEN>
 <87o8uyrlja.fsf@HIDDEN> <83pnfevsbv.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Date: Tue, 21 Jan 2020 04:04:18 +0100
Message-ID: <87muahmrwt.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - ted.gofardesign.uk
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - marxist.se
X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id:
 stefan@HIDDEN
X-Authenticated-Sender: ted.gofardesign.uk: stefan@HIDDEN
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> As for "causing more problems than it solves", I don't think I saw
> any evidence for that: even the one use case which started this bug
> report was later shown to behave as expected.

The recipe in the OP was:

> emacs -Q
> M-x term
> <ret> (to select /bin/bash)
> htop (to run htop)
> 
> and resizing the window (especially making it smaller) can make the
> program impossible to read.

When I do this on my machine, the output gets all messed up and
impossible to read.

Best regards,
Stefan Kangas




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 21 Jan 2020 17:12:02 +0000
Resent-Message-ID: <handler.37564.B37564.157962669127849 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Glenn Morris <rgm@HIDDEN>
Cc: matthew@HIDDEN, 37564 <at> debbugs.gnu.org, stefan@HIDDEN
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157962669127849
          (code B ref 37564); Tue, 21 Jan 2020 17:12:02 +0000
Received: (at 37564) by debbugs.gnu.org; 21 Jan 2020 17:11:31 +0000
Received: from localhost ([127.0.0.1]:48377 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1itx3o-0007F4-2G
	for submit <at> debbugs.gnu.org; Tue, 21 Jan 2020 12:11:31 -0500
Received: from eggs.gnu.org ([209.51.188.92]:35397)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1itx3j-0007Ej-MP
 for 37564 <at> debbugs.gnu.org; Tue, 21 Jan 2020 12:11:27 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:49758)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1itx3d-0005EM-LD; Tue, 21 Jan 2020 12:11:17 -0500
Received: from [176.228.60.248] (port=3629 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1itx3c-0003lI-E3; Tue, 21 Jan 2020 12:11:16 -0500
Date: Tue, 21 Jan 2020 19:11:26 +0200
Message-Id: <83y2u0vio1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <7nd0bd8w1e.fsf@HIDDEN> (message from Glenn Morris on
 Mon, 20 Jan 2020 19:58:53 -0500)
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN> <878sq0jqi6.fsf@HIDDEN>
 <87o8uyrlja.fsf@HIDDEN> <83pnfevsbv.fsf@HIDDEN>
 <7nd0bd8w1e.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Glenn Morris <rgm@HIDDEN>
> Cc: Stefan Kangas <stefan@HIDDEN>,  matthew@HIDDEN,  37564 <at> debbugs.gnu.org
> Date: Mon, 20 Jan 2020 19:58:53 -0500
> 
> 
> No other terminal emulator exports LINES and COLUMNS as environment variables.

Maybe so, but that in itself doesn't yet mean Emacs cannot do that, if
we decide it's useful.

> Applications use ioctl to get the size.
>    -> Therefore setting LINES and COLUMNS is pointless.
> If LINES/COLUMNS are set, they override ioctl.

Is the last bit a generally accepted paradigm?  I could easily justify
the contrary preference.

And then there might be applications that don't use ioctl.

> You can't update the environment of an already running process.
> Therefore the presence of LINES/COLUMNS in the initial environment
> of a process spawned from Emacs means it will fail to react to resizing.
>  Therefore exporting LINES and COLUMNS is harmful.

Only if the application uses the variables in preference to ioctl.

> So don't export LINES and COLUMNS.

I agreed at the very beginning of the discussion to make the export
optional.  I don't think we can safely remove that unconditionally,
not yet.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Matthew Leach <matthew@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 21 Jan 2020 18:11:01 +0000
Resent-Message-ID: <handler.37564.B37564.15796302539016 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Glenn Morris <rgm@HIDDEN>, 37564 <at> debbugs.gnu.org, stefan@HIDDEN
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.15796302539016
          (code B ref 37564); Tue, 21 Jan 2020 18:11:01 +0000
Received: (at 37564) by debbugs.gnu.org; 21 Jan 2020 18:10:53 +0000
Received: from localhost ([127.0.0.1]:48447 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1itxzG-0002LI-17
	for submit <at> debbugs.gnu.org; Tue, 21 Jan 2020 13:10:53 -0500
Received: from mx0.mattleach.net ([176.58.118.143]:55710)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <matthew@HIDDEN>) id 1itxzB-0002L7-OQ
 for 37564 <at> debbugs.gnu.org; Tue, 21 Jan 2020 13:10:49 -0500
Received: by mx0.mattleach.net (Postfix, from userid 99)
 id 2BD2D61DE6; Tue, 21 Jan 2020 18:10:45 +0000 (GMT)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mx0.mattleach.net
X-Spam-Level: 
X-Spam-Status: No, score=-1.0 required=4.0 tests=ALL_TRUSTED,URIBL_BLOCKED
 autolearn=disabled version=3.4.2
Received: from troi.mattleach.net (94.197.121.93.threembb.co.uk
 [94.197.121.93])
 by mx0.mattleach.net (Postfix) with ESMTPSA id 65E2C61C21;
 Tue, 21 Jan 2020 18:10:43 +0000 (GMT)
From: Matthew Leach <matthew@HIDDEN>
In-Reply-To: <83y2u0vio1.fsf@HIDDEN> (Eli Zaretskii's message of "Tue, 21 Jan
 2020 19:11:26 +0200")
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN> <878sq0jqi6.fsf@HIDDEN>
 <87o8uyrlja.fsf@HIDDEN> <83pnfevsbv.fsf@HIDDEN>
 <7nd0bd8w1e.fsf@HIDDEN> <83y2u0vio1.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)
Date: Tue, 21 Jan 2020 18:10:45 +0000
Message-ID: <87y2u0d6je.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> writes:


>> Applications use ioctl to get the size.
>>    -> Therefore setting LINES and COLUMNS is pointless.
>> If LINES/COLUMNS are set, they override ioctl.
>
> Is the last bit a generally accepted paradigm? 

I believe so, yes.  At least, that is the case with ncurses.
-- 
Matt




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Glenn Morris <rgm@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 22 Jan 2020 03:39:01 +0000
Resent-Message-ID: <handler.37564.B37564.157966430228932 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Eli Zaretskii <eliz@HIDDEN>
Cc: matthew@HIDDEN, 37564 <at> debbugs.gnu.org, Stefan Kangas <stefan@HIDDEN>
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157966430228932
          (code B ref 37564); Wed, 22 Jan 2020 03:39:01 +0000
Received: (at 37564) by debbugs.gnu.org; 22 Jan 2020 03:38:22 +0000
Received: from localhost ([127.0.0.1]:48838 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iu6qU-0007Wa-24
	for submit <at> debbugs.gnu.org; Tue, 21 Jan 2020 22:38:22 -0500
Received: from eggs.gnu.org ([209.51.188.92]:40806)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rgm@HIDDEN>) id 1iu6qS-0007WN-ON
 for 37564 <at> debbugs.gnu.org; Tue, 21 Jan 2020 22:38:21 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:59211)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rgm@HIDDEN>)
 id 1iu6qM-0002L1-GT; Tue, 21 Jan 2020 22:38:14 -0500
Received: from rgm by fencepost.gnu.org with local (Exim 4.82)
 (envelope-from <rgm@HIDDEN>)
 id 1iu6qI-0007KS-R2; Tue, 21 Jan 2020 22:38:11 -0500
From: Glenn Morris <rgm@HIDDEN>
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN> <878sq0jqi6.fsf@HIDDEN>
 <87o8uyrlja.fsf@HIDDEN> <83pnfevsbv.fsf@HIDDEN>
 <7nd0bd8w1e.fsf@HIDDEN>
X-Spook: Cyber Command Ft. Bragg FDA SP4 Pork Plame outage Bin
X-Ran: ?.eWok<;4mbn1o9j<Yq;F,N:lsMrWp+:AXX++67ao3A5?6&tp!!DFL<\\Y2|N\-#}xOJt}
X-Hue: red
X-Attribution: GM
Date: Tue, 21 Jan 2020 22:38:10 -0500
In-Reply-To: <7nd0bd8w1e.fsf@HIDDEN> (Glenn Morris's message of
 "Mon, 20 Jan 2020 19:58:53 -0500")
Message-ID: <ua7e1kma8t.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


PS for an example of the effect, one can use some of the programs in
the ncurses-examples from
https://invisible-island.net/ncurses/ncurses-examples.html

eg "worm".

If I run it in an xfce4-terminal, then maximise the terminal, the worms
spread over the whole screen.
If I "export LINES" and COLUMNS beforehand, then the worms don't expand
beyond the original terminal size.

The same effect is visible in Emacs's M-x term with and without the
LINES/COLUMNS variables.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 22 Jan 2020 15:47:01 +0000
Resent-Message-ID: <handler.37564.B37564.15797080038133 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Glenn Morris <rgm@HIDDEN>
Cc: matthew@HIDDEN, 37564 <at> debbugs.gnu.org, stefan@HIDDEN
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.15797080038133
          (code B ref 37564); Wed, 22 Jan 2020 15:47:01 +0000
Received: (at 37564) by debbugs.gnu.org; 22 Jan 2020 15:46:43 +0000
Received: from localhost ([127.0.0.1]:51149 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iuIDK-000276-OE
	for submit <at> debbugs.gnu.org; Wed, 22 Jan 2020 10:46:43 -0500
Received: from eggs.gnu.org ([209.51.188.92]:59670)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1iuIDI-00026p-Fv
 for 37564 <at> debbugs.gnu.org; Wed, 22 Jan 2020 10:46:41 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e]:39104)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1iuIDD-0005Ja-4W; Wed, 22 Jan 2020 10:46:35 -0500
Received: from [176.228.60.248] (port=2435 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1iuIDB-0000VT-48; Wed, 22 Jan 2020 10:46:33 -0500
Date: Wed, 22 Jan 2020 17:46:47 +0200
Message-Id: <83eevrv6hk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-reply-to: <ua7e1kma8t.fsf@HIDDEN> (message from Glenn Morris on
 Tue, 21 Jan 2020 22:38:10 -0500)
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN> <878sq0jqi6.fsf@HIDDEN>
 <87o8uyrlja.fsf@HIDDEN> <83pnfevsbv.fsf@HIDDEN>
 <7nd0bd8w1e.fsf@HIDDEN> <ua7e1kma8t.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Glenn Morris <rgm@HIDDEN>
> Cc: Stefan Kangas <stefan@HIDDEN>,  matthew@HIDDEN,  37564 <at> debbugs.gnu.org
> Date: Tue, 21 Jan 2020 22:38:10 -0500
> 
> 
> PS for an example of the effect, one can use some of the programs in
> the ncurses-examples from
> https://invisible-island.net/ncurses/ncurses-examples.html
> 
> eg "worm".

I understand that applications based on ncurses are affected, but what
about those which aren't based on ncurses?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications
Resent-From: Stefan Kangas <stefan@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 24 Jan 2020 18:09:02 +0000
Resent-Message-ID: <handler.37564.B37564.157988932621275 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 37564
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: Glenn Morris <rgm@HIDDEN>
Cc: matthew@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 37564 <at> debbugs.gnu.org
Received: via spool by 37564-submit <at> debbugs.gnu.org id=B37564.157988932621275
          (code B ref 37564); Fri, 24 Jan 2020 18:09:02 +0000
Received: (at 37564) by debbugs.gnu.org; 24 Jan 2020 18:08:46 +0000
Received: from localhost ([127.0.0.1]:54731 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iv3Nt-0005X4-Kd
	for submit <at> debbugs.gnu.org; Fri, 24 Jan 2020 13:08:45 -0500
Received: from ted.gofardesign.uk ([67.225.143.91]:44956)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefan@HIDDEN>) id 1iv3Ns-0005Wq-5f
 for 37564 <at> debbugs.gnu.org; Fri, 24 Jan 2020 13:08:44 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; 
 s=default;
 h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=VAzTuHelfFaVgmC7M+k2ujWBhWAr6o871G+1eOKX1qc=; b=OPDWxmDUnSrZeSQU07JpKaCS/0
 dGBJtxdW5eNDAwa4SoFK5GQFzeMXgE29zkoM/R+lSziW7km43QlHdWmDwxG2waHps3gNdJbBFHtR1
 JIQckfETu9h6t3NGIZPWq05dQB3A5s3kQZMgc3DyFoOlG8BzKU5goH8j5jK44DcgDHca+dtZllBbd
 O48Hf2IYf4AZwVK3QyC7T7gWk2RvaHSbUzRD+6fyVqC7FtuPpKhkm8LWCxsV6qItkI7BCNWIny/6i
 qPp+M5ONH6C1ZE6Zgo7nJYoWdQdbS2sXKKlGXTTMuZpNe4GOMuIKyYR431x8fE5oZMfuJfKTKC5AO
 m9Y5jcbA==;
Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:51612
 helo=localhost)
 by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256)
 (Exim 4.92) (envelope-from <stefan@HIDDEN>)
 id 1iv3Nj-001NbU-33; Fri, 24 Jan 2020 13:08:35 -0500
From: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <ua7e1kma8t.fsf@HIDDEN> (Glenn Morris's message of
 "Tue, 21 Jan 2020 22:38:10 -0500")
References: <87y2y5lfnb.fsf@HIDDEN> <83eezxatsv.fsf@HIDDEN>
 <87tv8slb6w.fsf@HIDDEN> <83a7aka1q5.fsf@HIDDEN>
 <87sgocfh8c.fsf@HIDDEN> <83y2y48f8u.fsf@HIDDEN>
 <87o8z0few1.fsf@HIDDEN> <83sgob98zk.fsf@HIDDEN>
 <9ipnjdemzv.fsf@HIDDEN> <878sq0jqi6.fsf@HIDDEN>
 <87o8uyrlja.fsf@HIDDEN> <83pnfevsbv.fsf@HIDDEN>
 <7nd0bd8w1e.fsf@HIDDEN> <ua7e1kma8t.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
Date: Fri, 24 Jan 2020 19:08:32 +0100
Message-ID: <87muac917j.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-AntiAbuse: This header was added to track abuse,
 please include it with any abuse report
X-AntiAbuse: Primary Hostname - ted.gofardesign.uk
X-AntiAbuse: Original Domain - debbugs.gnu.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - marxist.se
X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id:
 stefan@HIDDEN
X-Authenticated-Sender: ted.gofardesign.uk: stefan@HIDDEN
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Glenn Morris <rgm@HIDDEN> writes:

> PS for an example of the effect, one can use some of the programs in
> the ncurses-examples from
> https://invisible-island.net/ncurses/ncurses-examples.html
>
> eg "worm".
>
> If I run it in an xfce4-terminal, then maximise the terminal, the worms
> spread over the whole screen.
> If I "export LINES" and COLUMNS beforehand, then the worms don't expand
> beyond the original terminal size.
>
> The same effect is visible in Emacs's M-x term with and without the
> LINES/COLUMNS variables.

BTW, we also have Bug#11432.  Not sure if that should be merged with
this one.

Best regards,
Stefan Kangas





Last modified: Fri, 24 Jan 2020 18:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.