Re: [dev] Launching new terminals in $PWD

From: Chris Down <chris_AT_chrisdown.name>
Date: Fri, 18 Oct 2013 17:22:54 +0800

You should include the project you're referring to in your subject, otherwise
we have to guess what you're talking about. I guess this is about dwm, but
still...

On 2013-10-18 11:14, Manolo Martínez wrote:
> Still, I wonder, wouldn't it be possible to use config.h to bind a key
> combination to, say, "urxvt -cd $PWD", or "pwd | urxvt", or "urxvt -cd
> `pwd`". None of these options work, and I am not sure why -- I guess pipes
> cannot be used? And env variables are somehow not read?

These are all shell syntax, exec() and friends won't interpret them. Have them
interpreted by a shell if you want it to work.

Secondly, you never make it clear *who's* working directory you want to read.
Do you always want to be in dwm's working directory? The working directory from
the environment you are currently in (which may not be the same as dwm's)?

Also, urxvt(c) does not change the current working directory on launch, anyway.
You can see this quite easily by launching an urxvt instance, and then doing
`cd / && urxvt`. The new instance will have / as its current working directory.

In summary:

- This should be how it works just launching urxvt without any options
- If you really need to do this, get your shell to expand $PWD, or use a C
  function to pass it

Received on Fri Oct 18 2013 - 11:22:54 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 18 2013 - 11:24:17 CEST