Skip to content

feat: enhanced clipboard image paste with PyObjC subprocess#546

Closed
m0at wants to merge 1 commit intoNousResearch:mainfrom
m0at:pr/clipboard-image-paste
Closed

feat: enhanced clipboard image paste with PyObjC subprocess#546
m0at wants to merge 1 commit intoNousResearch:mainfrom
m0at:pr/clipboard-image-paste

Conversation

@m0at
Copy link

@m0at m0at commented Mar 6, 2026

Summary

  • Enhanced clipboard module with PyObjC subprocess for macOS clipboard access
  • Bypasses asyncio/CFRunLoop conflict that broke clipboard in async contexts
  • BMP→PNG conversion with ImageMagick fallback (restores original on failure)
  • Full CLI integration (keybindings, image badges, select mode) available in fork

Test plan

  • from hermes_cli.clipboard import get_clipboard_image works
  • Image paste captures PNG from macOS clipboard

🤖 Generated with Claude Code

Enhanced clipboard module with:
- PyObjC subprocess for macOS clipboard access (bypasses asyncio conflict)
- BMP→PNG conversion with ImageMagick fallback
- Robust error handling for missing clipboard tools

CLI integration (requires cli.py changes — see description):
- Ctrl+V / Alt+V / Ctrl+P keybindings for image paste
- [Image #N] display badges above input
- Up-arrow image select mode: navigate, delete attached images
- Image indicators in queued messages

Note: Full CLI integration requires changes to cli.py which heavily
diverge from upstream. See the fork's main branch for the complete
implementation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@teknium1
Copy link
Contributor

Closing — this bug was already fixed in commit c052022 (Mar 8). The current _convert_to_png() on main already restores the original file in both except handlers when ImageMagick is unavailable or fails.

Your PR is based on a stale branch that predates that fix. Thanks for spotting the issue though — it was a real bug!

@teknium1 teknium1 closed this Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants