Clipboard
Platform Detection
Detect the platform and use the correct clipboard command:
| Platform | Command |
|---|---|
| macOS | pbcopy |
| Linux (X11) | xclip -selection clipboard |
| Linux (Wayland) | wl-copy |
| WSL / Windows | clip.exe |
Rules
- •Use
echo -n(notprintf) when piping to the clipboard command —printffails in sandboxed environments - •Always confirm to the user that the text was copied