Re: [PATCH] honor and export $PWD

2011-12-07 Thread Nicholas Marriott
On Tue, Dec 06, 2011 at 06:05:30PM +0100, Matthias Lederhofer wrote: > Nicholas Marriott wrote: > > If you start PWD with it already in the environment, it is marked as > > exported - this is the same as any other variable: > > Ah, ok. Anyway it shows that ksh uses $PWD as any other shell, even

Re: [PATCH] honor and export $PWD

2011-12-06 Thread Matthias Lederhofer
Nicholas Marriott wrote: > If you start PWD with it already in the environment, it is marked as > exported - this is the same as any other variable: Ah, ok. Anyway it shows that ksh uses $PWD as any other shell, even though it doesn't export it by default. > For your use, you want to be able to

Re: [PATCH] honor and export $PWD

2011-12-06 Thread Nicholas Marriott
On Tue, Dec 06, 2011 at 07:43:18AM +0100, Matthias Lederhofer wrote: > Nicholas Marriott wrote: > > Well, not necessarily, ksh for example does not export PWD. > > I could not verify this (on openbsd): > > matled@openbsd:~% ksh If you start PWD with it already in the environment, it is mark

Re: [PATCH] honor and export $PWD

2011-12-05 Thread Matthias Lederhofer
Nicholas Marriott wrote: > Well, not necessarily, ksh for example does not export PWD. I could not verify this (on openbsd): matled@openbsd:~% ksh $ cd /tmp/b $ env |grep ^PWD /tmp/b $ sh -c pwd /tmp/b $ env -i sh -c pwd /tmp/a > > What do you mean by the last tw

Re: [PATCH] honor and export $PWD

2011-12-05 Thread Nicholas Marriott
On Mon, Dec 05, 2011 at 06:28:59PM +0100, Matthias Lederhofer wrote: > Nicholas Marriott wrote: > > I'm not really convinced by all the PWD talk, the canonical way to find > > the current working directory is to call getcwd(). Not to use PWD, that > > is just a shell convenience. I don't think app

Re: [PATCH] honor and export $PWD

2011-12-05 Thread Matthias Lederhofer
Nicholas Marriott wrote: > I'm not really convinced by all the PWD talk, the canonical way to find > the current working directory is to call getcwd(). Not to use PWD, that > is just a shell convenience. I don't think applications should ever need > to check PWD rather than calling getcwd(). They

Re: [PATCH] honor and export $PWD

2011-12-04 Thread Nicholas Marriott
On Sat, Dec 03, 2011 at 06:05:44PM +0100, Matthias Lederhofer wrote: > Nicholas Marriott wrote: > > Hmm. As far as I can see xterm doesn't set PWD, how come xterm doesn't > > have this problem? > > > > If you make sure your shell exports PWD and add it to > > update-environment, tmux will set it

Re: [PATCH] honor and export $PWD

2011-12-03 Thread Matthias Lederhofer
Nicholas Marriott wrote: > Hmm. As far as I can see xterm doesn't set PWD, how come xterm doesn't > have this problem? > > If you make sure your shell exports PWD and add it to > update-environment, tmux will set it in the environment. Does that not > that work? It might be easier to just add PWD

Re: [PATCH] honor and export $PWD

2011-12-01 Thread Nicholas Marriott
Hmm. As far as I can see xterm doesn't set PWD, how come xterm doesn't have this problem? If you make sure your shell exports PWD and add it to update-environment, tmux will set it in the environment. Does that not that work? It might be easier to just add PWD to update-environment by default. O