Re: [dev][dwm] Launching new terminals in $PWD

From: Manolo Martínez <manolo_AT_austrohungaro.com>
Date: Fri, 18 Oct 2013 13:29:04 +0200

On 10/18/13 at 03:05pm, Alexander S. wrote:
> 2013/10/18 Raphaël Proust <raphlalou_AT_gmail.com>:
> > On Fri, Oct 18, 2013 at 11:28 AM, Manolo Martínez
> > <manolo_AT_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
Received on Fri Oct 18 2013 - 13:29:04 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 18 2013 - 13:36:06 CEST