GNU bug report logs - #37564
[PATCH] don't export LINES and COLUMNS env vars in term to fix ncurses applications

Previous Next

Package: emacs;

Reported by: Matthew Leach <matthew <at> mattleach.net>

Date: Mon, 30 Sep 2019 20:00:02 UTC

Severity: normal

Tags: fixed, patch

Merged with 11432

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #62 received at 37564 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: matthew <at> mattleach.net, 37564 <at> debbugs.gnu.org, stefan <at> marxist.se
Subject: Re: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in
 term to fix ncurses applications
Date: Tue, 21 Jan 2020 19:11:26 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: Stefan Kangas <stefan <at> marxist.se>,  matthew <at> mattleach.net,  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.




This bug report was last modified 4 years and 269 days ago.

Previous Next


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