Developer builds cpcp to replace macOS pbcopy, fixing newline and ANSI code issues
A developer has released cpcp, a command-line clipboard utility for macOS designed to address longstanding limitations of the built-in pbcopy tool. By default, cpcp automatically strips trailing newlines, whitespace, and ANSI escape codes that pbcopy would otherwise copy verbatim. The tool also supports copying file contents or image assets directly by accepting file paths as arguments, and provides a subtle confirmation message when run interactively in a terminal. A key technical challenge during development involved macOS app sandboxing, which required the tool to write both a file URL and raw binary data to the clipboard so it would work across both Finder and sandboxed apps like Slack. cpcp is written in Swift and is currently available via a Homebrew tap, with the developer aiming to submit it to Homebrew Core once the project reaches 75 GitHub stars.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in