GNU bug report logs - #11432
Application that sets LINES/COLUMNS env vars behaves weird in term and ansi-term

Previous Next

Package: emacs;

Reported by: Nikos Chantziaras <realnc <at> gmail.com>

Date: Tue, 8 May 2012 16:20:01 UTC

Severity: normal

Tags: fixed, patch

Merged with 37564

Fixed in version 28.1

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

Bug is archived. No further changes may be made.

Full log


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

From: Nikos Chantziaras <realnc <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Application that sets LINES/COLUMNS env vars behaves weird in term
	and ansi-term
Date: Tue, 08 May 2012 16:56:03 +0300
I have a curses application (written in C++) that during start-up does:

  static char linesEnv[32];
  static char columnsEnv[32];
  /* Init the above vars */
  putenv(linesEnv);
  putenv(columnsEnv);

linesEnv and columnsEnv contain "LINES=N" and "COLUMNS=N" respectively, 
with N being the current terminal dimensions.

Now this sounds like a totally useless thing to do; why would you set 
these env vars if they're already set.  This is done in order to work 
around a bug in an old Solaris version.  But on other systems, this 
should have no effect.

But with emacs it does have an effect; the application's output is all 
messed up.  Characters appear in wrong places or entirely missing and 
everything is pretty much messed up.  I modified the program to not 
export the env vars when TERM=eterm (or eterm-color).  But in case this 
is a bug in Emacs, I'm reporting it here.

I'm using GNU Emacs 23.4.2 built without X support, with Ncurses 5.9 on 
Gentoo AMD64.  The problem also appears in Emacs 23.1 with X support on 
Ubuntu 10.04 (which is the system of the user who reported the problem 
to me.)





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

Previous Next


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