-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open in directory of current process #5
Comments
Hi @slakkenhuis, many thanks for your feedback.
No, go ahead! Please let me know the URL of this brand new repository so I can edit my post.
To be honest, I'm not a Perl expert but I think you could also find the proc name through |
Thanks! I took a look at how tmux does this. They use
Alas, that doesn't work. I think that
I put the repo at https://github.com/slakkenhuis/urxvt-cwd. Comments welcome :) |
The
urxvt
extension you wrote for opening a terminal in the same directory (cf https://raphael.medaer.me/2019/06/21/urxvt-open-current-wd.html) works pretty well, even with the daemon-client structure, and is indeed a better solution than X11 hacks. Thanks a lot!However, when the shell process forks, the working directory does not change together with the working directory of the child process. While that is sometimes desired behaviour (eg when having spawned a GUI app or some other background process), I often actually do want to use the cwd of the child process. This is usually for TUIs like vim or lf.
If this sounds like a good feature, I'd be happy to give it a shot myself and PR. (In that case, do you mind if I also copy your code into a dedicated repository?)
I don't know Perl, but I'm thinking that it could be achieved by examining
Proc::ProcessTable
for the most recent child process with a particular name (lf
andnvim
, in my case). To illustrate, the following does seem to work:However, it does feel rather hacky, so I'm curious what your thoughts are. Is there a better way?
If no better solution presents itself, I'll probably do something like this, but pull the names of the binaries from an environment variable, and only load the process table if that environment variable is non-empty.
The text was updated successfully, but these errors were encountered: