On 10/18/13 at 03:05pm, Alexander S. wrote: > 2013/10/18 Raphaël Proust <raphla...@gmail.com>: > > On Fri, Oct 18, 2013 at 11:28 AM, Manolo Martínez > > <man...@austrohungaro.com> wrote: > >> On 10/18/13 at 06:12pm, Chris Down wrote: > >>> On 2013-10-18 12:03, Manolo Martínez wrote: > >>> Environments only propagate to children, not their parents. You'll need > >>> to get > >>> the pwd of the currently focussed window if you want to do that. > >>> > >> > >> You meant "the pwd of the children of the currently focused window", > >> right? I've just seen that the pwd of urxvt is always my home directory, > >> even if the pwd of the shell process running in it is not. This is all > >> pretty arcane to me. > > > > AFAIU: if you `cd` in urxvt, the pwd of the urxvt process will change. > > If you `vim` and then `:cd` then pwd of the urxvt process will not > > change (i.e. the parent process (urxvt) keeps its pwd, while the child > > process (vim) will have a new pwd). > The "parent process" is shell, not the terminal. Terminal needs > explicit support to keep its pwd consistent with its shell's. > By the way, pwdx can be replaced by readlink("/proc/<pid>/cwd"). >
FYI, now that I know what I was actually looking for, [this guy](https://github.com/schischi-a/xcwd) has a small script that finds the pwd of the currently focused window. It appears to work. Manolo