help-gnu-emacs
[Top][All Lists]
Advanced

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

Emacs mishandles subshell's terminal's size


From: kj
Subject: Emacs mishandles subshell's terminal's size
Date: Mon, 6 Dec 2010 21:02:48 +0000 (UTC)
User-agent: nn/6.7.3



I often run zsh as a subprocess (which I'll denote zsh1) of an
Emacs process that is itself a subprocess of another zsh process
(which I'll denote zsh0); basically, a zsh0/Emacs/zsh1 sandwich.

(FWIW, I initiate the zsh1 by running "M-x shell" in Emacs.)

The problem I have is that the values of COLUMNS in zsh0 and zsh1
do not match (zsh0 being the one that has it right), even if I run
"export COLUMNS" right before starting Emacs.

In zsh0, I get the following:
% export COLUMNS
% typeset +m COLUMNS
integer 10 exported COLUMNS
% echo $COLUMNS
126

This width is correct.

If now I run Emacs, and in its *scratch* buffer I immediately
evaluate the Lisp expression "(window-width)", the value echoed is
126, in agreement with zsh0's $COLUMNS.  So Emacs *knows* the
correct window width.

But now, if I start zsh1 from this very same Emacs session, this
is what zsh1 reports:
% typeset +m COLUMNS
integer 10 exported COLUMNS
% echo $COLUMNS
80 

According to the Emacs documentation, Emacs inherits environment
variables from its parent shell, and passes those environment
variables to any subprocess shell it spawns.  Judging from the
above, this is apparently not happening for me.

How can I coax Emacs into setting the COLUMNS of the subshell
properly?

TIA!

~kj



reply via email to

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