hypercwd
hypercwd copied to clipboard
Sometimes new tab points to /
Sometimes when there is a long running process on current tab (for example watcher) new tabs opens to /
instead of current directory.
lsof -p PID | grep cwd | tr -s ' ' | cut -d ' ' -f9-
actually returns /
Maybe we need different way of tracking CWD?
Presumably this is the same problem as #5.
lsof -p PID | grep cwd | tr -s ' ' | cut -d ' ' -f9- actually returns / Maybe we need different way of tracking CWD?
What's wrong with pwd
?
It's returning /
for that PID so it's obviously not perfect. I didn't dive into internals of hyperterm yet but it would make sense for me that hyperterm tracks CWD of each tab.
Basically the way this works is it watches for new STDOUT or STDERR output or tabs and get's the cwd
from the process. So if you have a process (watcher
is one that does this I think) that changes it's directory while running and then spits out some output on STDOUT or STDERR it will cause new tabs to open to that directory.
Proof this isn't perfect, not sure how to fix this at the moment though 😬
I've the same issue. Whenever a process is running and I open a new tab I'm redirected to /
instead of the current directory.
Same here. Ironically, it is during a long-running process that I am most likely to need to open a new tab.
Sorry to beat a dead horse, but this doesn't work for me either.
I've run 'lsof -p PID | grep cwd | tr -s ' ' | cut -d ' ' -f9-' against the proper PID which produces:
--> /
When in fact the current tab is my home dir not root.
Can you elaborate why pwd
isn't sufficient?
I have a home directory that includes a symlink, and the lsof
approach unrolls that symlink to its effective location, so newly opened tabs will take me there as opposed to the symlinked path I came from.
Probably insignificant, but should also either add lsof
as a package requirement/dependency (at least in the readme/docs), or use another method to get cwd. I didn't have it installed and this plugin wasn't working for me until I debugged it.