feat(macos): add SSH image paste support#10515
feat(macos): add SSH image paste support#10515mvanhorn wants to merge 1 commit intoghostty-org:mainfrom
Conversation
When pasting an image from the clipboard while in an SSH session, automatically upload the image to the remote host via SCP and insert the remote file path instead. This uses SSH ControlMaster sockets for authentication, so it works seamlessly with existing SSH connections without password prompts. Features: - Auto-detect active SSH ControlMaster sockets - Upload clipboard images to /tmp/ on remote host - Insert remote path as text for tools like Claude Code - Graceful fallback when not in SSH session Config options (in src/config/Config.zig): - ssh-image-paste: bool (default: true) - ssh-image-paste-path: string (default: /tmp) Co-Authored-By: Claude <noreply@anthropic.com>
|
as noted by the AI policy, any AI assisted PRs need to be an accepted issue not random PRs
|
|
Closing this due to violating our policies. I converted your issue to a discussion, as the guidelines also suggest. There was a lot of failure to read the instructions here which is highly questionable, but I will review your discussion in due time. |
|
Thanks for the feedback @mitchellh and @Brice-W! I looked into OSC 5522 and you're right - that's the proper way to solve this. My SCP/ControlMaster approach works but it's definitely a hack compared to having native terminal protocol support for typed clipboard data. The OSC 5522 protocol handles:
I'd be happy to help implement OSC 5522 in Ghostty if that would be useful. I could start by:
Let me know if this is something you'd want help with, or if there's already work in progress. Happy to close this PR since OSC 5522 is the better path forward. |
|
I'm seeing that both the PR and #10516 were closed without any additional comments... Still seems to be broken. Is there any plan to support this? @mitchellh |
Given multiple contribution guidelines were not followed thats why it was closed without anything further. Mitchell explained the next step (make a discussion) This also is not "broken" as it was never a feature and its a hack to scp a file over ssh when you detect its a image there are real protocols for this like osc5522 (which has a discussion) which lers remote hosts copy from and to the clipboard multiple datatypes (not plain text) |
Closes #10516
Summary
When pasting an image from the clipboard while in an SSH session, Ghostty now automatically uploads the image to the remote host via SCP and inserts the remote file path instead.
This enables seamless image sharing with remote tools like Claude Code that can read local files but not the local clipboard.
How it works
/tmp/ghostty-paste-{uuid}.pngon remoteUses existing SSH ControlMaster sockets for authentication - no password prompts.
Changes
macos/Sources/Helpers/SSHImagePaste.swift- Core upload logic (280 lines)macos/Sources/Helpers/Extensions/NSPasteboard+Extension.swift- Image detectionmacos/Sources/Ghostty/Ghostty.App.swift- Integration in clipboard handlingsrc/config/Config.zig- Config optionsConfig options
Test plan
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com