logoalt Hacker News

etaioinshrdlulast Sunday at 10:10 PM1 replyview on HN

It makes sense - i build something very similar for my company over the last couple weeks :)

I have a tweak that allows pasting images to claude code over SSH:

How it works:

PTY Interception: It creates a pseudo-terminal (PTY) to wrap the SSH process, allowing it to sit as a "man-in-the-middle" between your keyboard and the remote shell.

Bracketed Paste Detection: It monitors stdin for "bracketed paste" sequences (the control codes terminals send when you Cmd+V or drag-and-drop a file).

The "Hook": When a paste occurs, it pauses execution and scans the text for local macOS file paths.

Auto-Sync: If a local path is found, it immediately syncs that file to the remote server (using the provided SSH key) in the background.

Transparent Forwarding: Once the sync is complete, it forwards the original text to the shell.

You can drag and drop a file from your local Finder into a remote SSH session, and the file is automatically uploaded to the server before the path appears on the command line. Also works with copy paste, screnshots.


Replies

nllast Monday at 11:52 AM

Are you aware of iterm2's Inline Images Protocol (which I think is supported in some other terminals)?

https://iterm2.com/documentation-images.html