Paste/drop images into the terminal as files (M1: local)#29
Draft
mvbmir wants to merge 1 commit into
Draft
Conversation
Image bytes can't ride a PTY and a TUI agent CLI can't receive them, so (like cmux's drop-to-file) intercept the image client-side, write it to a temp PNG, and inject the file path as text. The agent's file-read tool opens the real file. - Ctrl+V: when the clipboard holds an image, read the texture, save /tmp/limux-drop-<uuid>.png, paste the shell-escaped path; falls through to normal text paste otherwise. - Drag-drop: a DropTarget for GdkTexture mirrors the same write-file-and-paste. Local only; SSH parity (write on the remote over ControlMaster) tracked in #28.
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
M1 of the cmux-style image drop-to-file feature (#28): paste or drop an image into a terminal and it lands as a real file, with the path injected as text — so it works with TUI agent CLIs (Claude Code, Codex) that can't receive image bytes over a PTY.
What it does
/tmp/limux-drop-<uuid>.png, and paste the shell-escaped path. Falls through to normal text paste when there's no image.DropTargetforGdkTexturedoes the same write-file-and-paste-path.clipboard_formats_include_image,shell_escape_joined_bytes, the file-drop inject path).One file, +74 lines, on top of upstream
main.Scope
Local only. The file is written on the box running limux, so the path resolves for agents running locally. SSH parity (write the file on the remote over the existing connection / ControlMaster, like cmux) is the separate M2, tracked in #28 — the foreground-ssh-detection spike there already passed.
Test
/tmp/limux-drop-*.pngpath is pasted; the file exists and opens.Draft: pending local verification of the paste/drop UX.
Part of #28.