emacs-direnv icon indicating copy to clipboard operation
emacs-direnv copied to clipboard

add support for TRAMP

Open bricewge opened this issue 5 years ago • 5 comments

Having support for TRAMP would allow the use of emacs-direnv on remote machines.

bricewge avatar Jun 01 '19 19:06 bricewge

i don't really see how that could work. this package patches the local env inside emacs, and inherently acts locally

wbolster avatar Jun 17 '19 17:06 wbolster

I think it need to patch the remote tramp environment instead of the local when in a tramp directory. Some example of changes are call-process should be replaced by process-file and process-environment by tramp-remote-process-environment.

Some days ago I ran into a package that added tramp support with a couple of line patch, unfortunately I can't manage to find it today. The only lead I have ATM is that page page of the TRAMP manual on how to integrate it with other packages.

EDIT: In emacs 27.1 executable-find can take an optional remote argument, see here.

bricewge avatar Jul 06 '19 12:07 bricewge

I have just integrated Direnv with Tramp in my own configuration by prefixing commands executed in Tramp with direnv exec <default-directory>. I advised tramp-sh-handle-start-file-process instead of dealing with tramp-remote-process-environment, which goes quite contrary to how emacs-direnv operates and is less efficient, but it works.

eush77 avatar Apr 20 '20 12:04 eush77

@wbolster any update? There seems to be a pull request.

tshu-w avatar Jan 15 '21 02:01 tshu-w

Any update? Two packages I know both don't support tramp, envrc and emacs-direnv.

mrunhap avatar Apr 23 '24 16:04 mrunhap