[xmonad] darcs patch: XMonad.Core: make spawn smarter

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Sat Sep 27 12:54:07 EDT 2008


On 2008 Sep 27, at 11:15, Gwern Branwen wrote:
> On 2008.09.26 21:38:54 -0400, "Brandon S. Allbery KF8NH" <allbery at ece.cmu.edu 
> > scribbled 0.9K characters:
>> On 2008 Sep 26, at 21:11, Devin Mullins wrote:
>>> On Fri, Sep 26, 2008 at 06:04:54PM -0400, Gwern Branwen wrote:
>>>> A user's shell when invoked as /bin/sh throws away a lot of their
>>>> customizations and addons; I wrote this patch for a user on #xmonad
>>>> who was perplexed why some of his scripts and other shell things  
>>>> were
>>>> simply Not Working.
>>>
>>> Hrm, that makes sense. If you're used to some particular bash-only
>>> syntax, you might expect it to work inside spawn.
>>
>> Traditional Unix behavior is that something spawned programmatically
>> should use /bin/sh to get a consistent environment, while something
>> spawned via user interaction should use the user's $SHELL.  Quite
>
> Or, we could be friendly & helpful & make a simple 1 or 2 line  
> change and never have to discuss it again. I don't see any real  
> upside to the 'consistent environment' of /bin/sh; if anything,  
> going through $SHELL is what would provide a 'consistent  
> environment', since what the user is actually using and running in  
> is $SHELL.

I think you misunderstood what I was getting at:  the stuff you're  
talking about is user interaction-based, so should use $SHELL.  The  
other case is for if you're writing code to launch an xmobar or xset,  
etc. and don't want to have to worry if the user's shell needs more  
quoting than /bin/sh does (or possibly isn't compatible with /bin/sh  
at all; what happens if $SHELL is rc?) --- this is the "consistency"  
part.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the xmonad mailing list