Repository navigation
Add ghostel-send-files-function for dropped and pasted files - #793
Merged
Merged
Conversation
dakra
force-pushed
the
feat/send-files-function
branch
3 times, most recently
from
November 6, 2026 22:07
76f63f5 to
62dd04a
Compare
A file dropped on a terminal, or an image pasted with yank-media, is pasted as a shell-quoted local path. That is wrong for a client that bridges a terminal on another machine, such as rexel: the path does not exist there. ghostel-send-files-function, when set, receives the local file names instead of the paste, next to ghostel-pty-out-function and ghostel-resize-function. ghostel--init-buffer clears it with them. The call counts as user input, as the paste does. A pasted image goes to the function as a file on this machine. Without the function it is still written to the temp directory of a remote default-directory, where the shell reads it. With the function set, a terminal needs no live process for either entry point: the client decides what to do with the files.
dakra
force-pushed
the
feat/send-files-function
branch
from
November 6, 2026 22:08
62dd04a to
3f3631e
Compare
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A file dropped on a terminal, or an image pasted with
yank-media, is pasted as a shell-quoted local path. A client that bridges a terminal on another machine, such as rexel, needs the files themselves: the local path does not exist where the program runs.ghostel-send-files-functionsits next toghostel-pty-out-functionandghostel-resize-function. When set, it receives the list of local file names and nothing is pasted:All three entry points go through that function: the
dnd-protocol-alisthandler (X11, pgtk),ghostel--drop(NS, w32) andghostel--yank-media-data. The call counts as user input, as the paste does.A pasted image reaches the function as a file on this machine. Without the function it is still written to the temp directory of a remote
default-directory, where the shell reads it. A bridged terminal can have a remotedefault-directoryfrom the shell's OSC 7 report.A terminal without a process but with
ghostel-pty-out-functionnow counts as live for the two entry points that check:ghostel--dnd-handle-fileopened the dropped file in Emacs.ghostel--yank-media-datasignalled "Terminal has no live process".ghostel--init-bufferclears the new variable with the other two bridge functions.Testing
ghostel--droppaths and nothing is pasted; it gets a local file for a pasted image with a remotedefault-directory; a dead terminal opens a dropped file and does not call it; a processless terminal pastes a dropped file and accepts a pasted image;ghostel--init-bufferclears the variable.make test test-native test-evil test-consult lintpasses against an existing module build, apart from 12ghostel-module-testtests that fail the same way onmainon my machine (a native-comp trampoline link error). The module build andmake test-zigdid not run locally: the machine has Zig 0.17.1. The change is Lisp only.dnd-handle-multiple-urlsand a syntheticghostel--dropevent and an image throughghostel--yank-media-dataall reached the hook and were uploaded.