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 #35 received at 37564 <at> debbugs.gnu.org (full text, mbox):

From: Matthew Leach <matthew <at> mattleach.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 37564 <at> debbugs.gnu.org
Subject: Re: bug#37564: [PATCH] don't export LINES and COLUMNS env vars in
 term to fix ncurses applications
Date: Fri, 04 Oct 2019 19:47:41 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Matthew Leach <matthew <at> mattleach.net>
>> 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 <at> hopton ~ $ env | grep -i lines
>> LINES=30
>> matthew <at> 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




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.