Repository navigation
feat: drop an image on a terminal to upload it - #90
Merged
Merged
Conversation
The docs say "Paste or drop an image into a terminal", but only paste and the toolbar button worked. A file dropped on a terminal did nothing in the desktop app, and the browser opened it in a new tab. Images dropped on the terminal now go through the same upload as a pasted image and their paths are typed in drop order. A drop with no image shows the existing "Choose an image file" message. Drags without files are left alone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
AI review | Looks safe to merge Adds drag-and-drop image upload to the terminal frontend, reusing existing upload logic and adding a visual overlay. No backend or security changes. Reviewed bbbf5c3. AI can be wrong, a maintainer still decides. Comment |
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.
Problem
The docs say "Paste or drop an image into a terminal and Termix uploads it to the host and types its path", but only paste and the toolbar button do that. The terminal has no drop handling:
This is handy to have for coding agents in the terminal, where a screenshot is usually a file on the desktop rather than something on the clipboard.
Change
handleImageUpload, the same path as a pasted or picked image. No backend, API or settings changes; the upload is sent withsource: "file".terminal.imageDropHintinlocales/en.jsononly.The logic is in a new
terminal-image-drop.ts, next toterminal-native-paste.ts.Terminal.tsxspreads the four handlers on the terminal's container. CHANGELOG entry under 1.4.1.Not included: dropping files onto a waiting
rz(the ZMODEM bar keeps its own file picker), and files that are not images.Testing
terminal-image-drop.test.ts(7 cases): image upload, order with mixed files, a drop with no image, drags without files, and the drag-over state across child elements and after a drop.DragEvents andDataTransferfiles: the overlay shows and clears, images arrive in order, a PDF is refused without the browser opening it, and a text drag is untouched.🤖 Generated with Claude Code