[Top][All Lists]

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

Re: (getenv "TERM") always returns "dumb"

From: Davis Herring
Subject: Re: (getenv "TERM") always returns "dumb"
Date: Tue, 31 Aug 2004 14:11:48 -0600 (MDT)

> I still think the change is basically right, but I agree that we should
> probably revert it since noone seems to have the time or inclination to do
> the additional necessary changes (i.e. keep TERM set until after running
> the terminal-specific config file and stash the original TERM value
> somewhere so that a new `terminal-type' function can return it to code that
> needs it).

How about a variable `process-terminal-type' (default: "dumb") that is
automatically subbed into `process-environment' when starting a
subprocess?  This would be best done in `child_setup' (callproc.c) like
PWD is now, but it could even be done in Lisp.  Several packages already
do tricks like this (`man.el' let-binds `process-environment' to do
exactly this; `comint.el' let-binds it to a constructed sequence with new
TERM settings), so it shouldn't cause any problems.  However, that would
necessitate a(nother) wrapper layer for `start-process', `call-process',
and `call-process-region'.

On the subject of PWD in callproc.c, why are some environment references 
done with egetenv() and others with plain getenv()?  There are no comments 
describing the inconsistency, and while I can understand wanting the 
"original" value of a variable (particularly in uses where Lisp is not 
aware that the environment is being consulted, so there are no issues of 
surprise), there is not even consistency among the uses of single 
variables (like TMPDIR).

Davis Herring

This product is sold by volume, not by mass.  If it seems too dense or too 
sparse, it means mass-energy conversion has occurred during shipping.

reply via email to

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