xclip
xclip copied to clipboard
Does anyone use xclip successfuly on Mac? How?
Trying to use xclip to paste html into Gmail. Works flawlessly on Linux, doesn't work at all on Mac. No error, so I guess it makes it to X11's clipboard but when trying to paste into the browser nothing happens.
I understand that X11's clipboard and Mac's clipboard are different (which makes sense). Is there any way to cross that barrier? Oh, I am using XA_CLIPBOARD to store the text.
Thank you!
Hello everyone,
I am having an issue with mac as well. pbcopy & pbpaste aliases works well when using only the terminal.
But when I try, for example, pbcopy something and then command+v somewhere, it doesn't work as I would like.
I don't know if I am missing some step to do locally.
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
I am using xclip 0.13 installed from brew & XQuartz 2.7.11
Best,
If the copy is working within XQuartz but not being sent outside of it to MacOS, then the problem is likely with an XQuartz setting. Look in the menus and see if you can find a option that says something like, "Copy X clipboard to System", or "Synchronize Clipboards". If there isn't one, then it's possible XQuartz simply cannot do that.
@alexaandru Did you ever get this figured out?
i think $DISPLAY has to be defined.
You can use pbcopy or pbpaste in mac I think
curl: (22) The requested URL returned error: 404
❌
$ brew install xclip
==> Downloading https://formulae.brew.sh/api/formula.jws.json
curl: (22) The requested URL returned error: 404
Error: Failure while executing; `/usr/bin/env /usr/local/Homebrew/Library/Homebrew/shims/shared/curl --disable --cookie /dev/null --globoff --user-agent Homebrew/4.0.10\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 13.1\)\ curl/7.85.0 --header Accept-Language:\ en --fail --progress-bar --location --remote-time --output /Users/xgqfrms-mm/Library/Caches/Homebrew/api/formula.jws.json --compressed --speed-limit 100 --speed-time 5 --progress-bar https://formulae.brew.sh/api/formula.jws.json` exited with 22. Here's the output:
curl: (22) The requested URL returned error: 404
still working?
@yashkumarverma-fampay I recommend using pbcopy on macOS, that is a better solution.
I am having the same issue with tmux
and vi
mode.
This was my default config using xclip
# Copy to clipboard on 'y'ank
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# Copy to clipboard on mouse release
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
I have also tried the reattach-to-user-namespace
wrapper.
# Wrapper to allow copy-paste to clipboard on OSX
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
set-option -g default-command "reattach-to-user-namespace -l zsh"
# Copy to clipboard on 'y'ank
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
# Copy to clipboard on mouse release
bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel 'reattach-to-user-namespace pbcopy'
It doesn't really matter whether I have the copyOnSelect
option set to true
, in this instance. Same for set -g set-clipboard on
.
Note that my default config works fine in Warp (though some other things do not, which is why I switched to Hyper).
Any ideas?
- References: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard