On Wed, 8 Nov 2017 10:55:20 -0800 vcap...@pengaru.com wrote: > On Wed, Nov 08, 2017 at 06:48:22PM +0100, Amadeusz Sławiński wrote: > > On Tue, 31 Oct 2017 19:30:35 -0700 > > Vito Caputo <vcap...@pengaru.com> wrote: > > > > > s is an RC_CHDIR convenience helper which discovers the working > > > directory of the foreground window. > > > > Hey, > > > > I'm not sure about this patch, seems to be overly linux specific to me. > > > > Also, you can have nested shells, which will probably make it behave in > > ways you don't expect it to behave (by changing to parent directory > > instead of childs). > > > > Amadeusz > > Is there a way to achieve the same thing purely through runtime > configuration? > > If not, perhaps just a minimum of extension can be done to make that > possible in a more OS-agnostic way. > > Assigning a key to perform RC_CHDIR on a string acquired from an external > command which can be fed the PID of the foreground window's process through > a configurable format string is the kind of thing I'm imagining. Then in > my use case I'd just do the linux-specific assume-no-subshells /proc-based > introspection in the external command referenced in my config. > > If this is already possible, please let me know, thanks. > > Regards, > Vito Caputo
Hey, I wrote quick shell function, seems to work both with bash and zsh cd () { builtin cd $@ if [[ ${STY} ]]; then screen -S "${STY}" -X chdir ${PWD} fi } and does it automatically, ie you don't need to run some shortcuts etc. Cheers, Amadeusz