Skip to content

Run eshell visual commands from TRAMP directories - #694

Merged
dakra merged 1 commit into
mainfrom
fix/eshell-visual-remote-path
Sep 16, 2026
Merged

dakra merged 1 commit into
mainfrom
fix/eshell-visual-remote-path

Conversation

@dakra

@dakra dakra commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Fixes #693.

eshell-find-interpreter resolves a command on a remote default-directory to a TRAMP-prefixed path such as /ssh:remote:/usr/bin/tmux. ghostel--spawn-process passed that verbatim into the remote /bin/sh -c '...; exec PROGRAM' wrapper, so the remote shell failed with "No such file or directory" (exit 126). The remote branch now strips the program to its local name, which covers every caller.

The "Selecting deleted buffer" message came from a second problem in the eshell wrapper: ghostel-kill-buffer-on-exit was only set buffer-locally after ghostel-exec returned. When TRAMP processed the immediate exit while still inside make-process, the sentinel killed the buffer with the global default and the following with-current-buffer failed. The setting is now let-bound around the spawn, and a buffer whose child already exited gets its exit handling (the q dismiss binding) applied directly.

Reproduced and verified with TRAMP's mock method. Not tested against a real ssh host.

`eshell-find-interpreter' resolves a command on a remote directory to a
TRAMP-prefixed path, which was passed verbatim to the remote shell's
exec.  `ghostel--spawn-process' now strips it to the local name for
remote spawns.

The eshell wrapper set `ghostel-kill-buffer-on-exit' only after
`ghostel-exec' returned, so an exit processed while TRAMP was still
spawning killed the buffer with the global default and the following
`with-current-buffer' failed with "Selecting deleted buffer".  The
setting is let-bound around the spawn, and a buffer whose child already
exited gets its exit handling applied directly.

Fixes #693
@dakra
dakra merged commit 4925190 into main Sep 16, 2026
27 checks passed
@dakra
dakra deleted the fix/eshell-visual-remote-path branch September 16, 2026 20:11

This branch was successfully deployed

1 active deployment
github-pages — 4925190c Deployed Sep 16, 2026 by dakra via deploy #194
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to run visual command on tramp path

1 participant