martanne / dvtm

dvtm brings the concept of tiling window management, popularized by X11-window managers like dwm to the console. As a console window manager it tries to make it easy to work with multiple console based programs.
MIT License
855 stars 106 forks source link

copymode: Set cwd so paths make sense in editor #98

Closed sh4r1k7 closed 3 years ago

sh4r1k7 commented 5 years ago

...to work with grep and friends, particularly useful with vis-goto-file plugin.

KAction commented 3 years ago

I think it quite hard even in basic case -- when we are talking about direct child, and impossible in general case.

As far as I know, fetching current directory of another process is possible via /proc, but not portable. And in general case, suppose you have following process tree:

dvtm (/home/user)
 \- bash (/etc)
  \- wget (/home/user/download) (background process)
  \- vim (/home/user/source)

And at this point user enters copy mode. What should be cwd of editor invoked?

sh4r1k7 commented 3 years ago

I don't understand - this is a fully working implementation which is as portable as the rest of dvtm. And as I said the intention is for the output of grep etc from the shell. In any case, the current default of supplying NULL is not useful at all.

KAction commented 3 years ago

Sorry, I missed your commit. I though it was just issue.

Then I take my concerns back and I fully support merging of this patch.