Skip to content

feat: add macOS support with pngpaste#4

Open
Jehu wants to merge 1 commit intojkhas8:masterfrom
Jehu:master
Open

feat: add macOS support with pngpaste#4
Jehu wants to merge 1 commit intojkhas8:masterfrom
Jehu:master

Conversation

@Jehu
Copy link
Copy Markdown

@Jehu Jehu commented Apr 10, 2026

Summary

This PR adds macOS support to tmux-paste-image, which previously only worked on Linux (X11/Wayland).

Changes

  • macOS clipboard support: Uses pngpaste on macOS instead of xclip/wl-paste. Installable via brew install pngpaste.
  • Fix tilde (~) expansion: The save path from tmux config (e.g. @paste-image-path ~/Pictures/clipboard-pastes) was passed as a literal ~ string. Now properly expands ~ and $HOME in the paster script.
  • macOS-compatible path resolution: Replaces readlink -f (not available on macOS by default) with a cross-platform _resolve_path() function that tries greadlink, then readlink -f, then falls back to manual resolution.

Testing

Tested on macOS 15 with:

  • pngpaste installed via Homebrew
  • Images copied to clipboard via Cmd+Shift+4
  • prefix + P correctly saves image and pastes path into pane
  • Claude Code detection and /image command integration works

Dependencies (macOS only)

brew install pngpaste

- Use pngpaste on macOS instead of xclip/wl-paste
- Fix tilde (~) expansion in save path from tmux config
- macOS-compatible path resolution (readlink -f fallback)
- Proper platform detection via uname
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.

1 participant