all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: kj <no.email@please.post>
To: help-gnu-emacs@gnu.org
Subject: Emacs mishandles subshell's terminal's size
Date: Mon, 6 Dec 2010 21:02:48 +0000 (UTC)	[thread overview]
Message-ID: <idjj1o$jba$2@reader1.panix.com> (raw)




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	other threads:[~2010-12-06 21:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='idjj1o$jba$2@reader1.panix.com' \
    --to=no.email@please.post \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.