Bug 92650 - Clipboard Syncing Not Working Properly
Summary: Clipboard Syncing Not Working Properly
Alias: None
Product: XQuartz
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 2.7.8 (xserver-1.16.4)
Hardware: x86-64 (AMD64) Mac OS X (All)
: medium normal
Assignee: Jeremy Huddleston Sequoia
QA Contact: Jeremy Huddleston Sequoia
Depends on:
Reported: 2015-10-23 18:50 UTC by Tudor Bosman
Modified: 2017-11-18 18:49 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Description Tudor Bosman 2015-10-23 18:50:53 UTC
This is refiling https://xquartz.macosforge.org/trac/ticket/519, which I just encountered.

Tested on OS X 10.10.5, XQuartz 2.7.8.

Syncing between system pasteboard and X clipboard doesn't work until you go to XQuartz preferences / Pasteboard, uncheck "Enable syncing", and re-enable it again.

I have XQuartz configured to enable syncing between system pasteboard and X11 CLIPBOARD. ("Enable syncing" and "Update pasteboard when CLIPBOARD changes" are both checked)

I reproduced by ssh'ing to a Linux box (with trusted X11 forwarding, ssh -Y), then "echo foo | xclip -selection clipboard", then tried to paste in a separate OS X terminal window (either using Command-V or with pbpaste). Didn't work. I then went to XQuartz settings, unchecked "Enabled syncing", re-enabled it, tried again, and it worked.
Comment 1 h4x3rotab 2015-12-15 02:49:45 UTC
Also encountered the same issue. OS X 10.11.2, XQuartz 2.7.8.
Comment 2 Jeremy 2016-01-31 08:19:57 UTC
Also seeing the same behavior running XQuartz 2.7.8 and El Capitan 10.11.3
Comment 3 JK 2016-03-30 09:40:43 UTC
Running into this on OS X 10.11.3 and XQuartz 2.7.8.
Comment 4 Robert Welsh 2016-05-02 21:06:02 UTC
I'm on Mac OS X 10.11.4 and Quartz 2.7.8. I can get copy-paste (middle mouse button) to only work within the scope of X11/XQuartz, but never between X11/XQuartz and MAC OS X.

I've tried all various incantations of turning clipboard/pasteboard check boxes on and off. Even tried killing the process "pboard", but all to no result.
Comment 5 halitdoganeem 2016-11-12 05:07:28 UTC
I had the same issue. My problem was to select a text in XQuartz window and paste it in to excel. I open the preferences, and I unchecked the first three options under "enable synching" option in the "pasteboard" tab, leaving "Update Pasteboard immediately when new text is selected" checked. That solved my problem.
Comment 6 xdxing 2016-12-01 09:38:23 UTC
The behaviour of copy/paste between XQuartz(2.7.11(xorg-server 1.18.4)) and Mac(Sierra 10.12.1) is unpredictable. 

Occasionally it works well in both directions, then it simply stopped working for no reason. I have made a lot of experiments trying to figure out the trick in it but got nothing. But one thing is for sure: it's always functioning as expected for a short time when a new session is just launched.

I've also tried toggling the XQuartz preference buttons in almost all combinations and didn't make any difference.
Comment 7 altlist 2016-12-01 21:05:03 UTC
Copying from XQuartz to the Mac consistently works for me.

Going from the Mac to XQuartz almost never works.  But someone at my company figured out a workaround that works every time so far.

  1. Copy the text on the mac
  2. Switch to XQuartz via one of the menu bars
  3. At the top menu bar, click and unclick the "Edit" menu
  4. Paste

Hopefully this gives enough clues what should be fixed.
Comment 8 Derrick Rice 2017-01-12 14:08:53 UTC
I also have been experiencing this. I use xQuartz exclusively for it's functionality of syncing the X11 clipboard to the OS X pasteboard, so this breaks my workflow (https://xkcd.com/1172/ :-P )

It seemed to be working for a while with Sierra, but recently I have been unable to get it functioning again despite restarts reboots and changes to configuration.

I, too, experience that XQuartz will sync the clipboard to the pasteboard at the moment when I change some setting related to syncing. For example:

> ssh -Y <server>
> echo 'new content' | xclip -selection clipboard -i
> # Attempting to paste on OS X does not show "new content"
> # Edit sync settings in XQuartz
> # Now attempting to paste on OS X *DOES* show "new content"

So this seems to be something with detecting that the clipboard has changed, perhaps?

I'm open to putting in some effort to help find some root cause. @Jeremy, current assignee, is this on your To-Do list? Can you provide some guidance on additional data that might be helpful?
Comment 9 machaira9 2017-02-02 02:32:21 UTC
I just started experiencing this issue last week. It was working fine up until that point. Here are a few things that happened right before it stopped working:

* Rebooted remote server (likely included some updates, but I'd have to dig into it to be sure).
* Upgraded to OS X Sierra.
* Pretty sure Xcode and/or XQuartz got updated before and/or during the Sierra upgrade, but I'm not sure.

So I'm not sure what the root cause is, but here's what I'm observing:

* Syncing local Pasteboard to remote CLIPBOARD doesn't work at all, even if I uncheck/check boxes under the 'Pasteboard' tab of the X11 Preferences.
* Syncing remote CLIPBOARD to local Pasteboard won't work by default, but if I uncheck and then check "Update Pasteboard when CLIPBOARD changes", the local Pasteboard will be updated with the contents of the remote CLIPBOARD. However, this is a one-time occurrence, and I have to uncheck/check the box every time I want the local Pasteboard to be updated.

Anything I can do to help diagnose and/or fix this?
Comment 10 Claude Heintz 2017-02-11 16:02:58 UTC
I experienced the problem where text copied from BBEdit would not paste into the XQuartz application.  In my case it was MIT-Scheme but I also tried just plain xterm.

After all sorts of turning on and off of XQuartz preferences and trying to figure it out, for convenience, I stopped using BBEdit and tried copy from Safari (actually text from the bugzilla page) and lo and behold, the paste worked.

I tried BBEdit, same problem, no paste.

I tried TextEdit, copy of random text and paste into XQuartz worked.

I tried copying the text from BBEdit into TextEdit on the theory that the issue was somehow BBEdit related.  Copied that text from TextEdit and tried pasting into XQuartz, no go, the clipboard remained the same as the last test.

Tried other text, it worked.  Tried my Lisp text, not.

Finally realized that it was the specific text and probably the apostrophe that was preventing the paste:

(cdr ’((x1 x2) (y1 y2)))

Does not paste from BBEdit to XQuartz

(cdr ((x1 x2) (y1 y2)))

Does paste from BBEdit to XQuartz.

I hope that this may help track down the issue.  I'll avoid apostrophes for now.
Comment 11 Jeremy Huddleston Sequoia 2017-02-11 19:17:54 UTC
I just tried BBEDit 11.6.3, and it worked fine.

Your sample includes a single quite, not an apostrophe.  I tested with both an apostrophe and a single quote, and both worked fine...
Comment 12 Charles Weill 2017-05-10 22:09:18 UTC
Any updates on this? I'm running into this issue as well when trying to copy/paste from emacs running on a remote host via xclip or xsel:

Similar steps to repro as Derrick Rice:

> ssh -Y <server>
> echo 'new content' | xclip -selection clipboard # alternatively: xsel -ib
> # Attempting to paste on OS X does not show "new content"
> # Edit sync settings in XQuartz
> # Now attempting to paste on OS X *DOES* show "new content"

I know some Objective-C and would be happy to help. I read through the contributing guidelines but can't successfully build and run the xorg-server with XCode. Are there better instructions for contributing to XQuartz with XCode somewhere?

Comment 13 Amr 2017-07-11 21:54:12 UTC
I also ran into this (OS X 10.11.4, connecting to CentOS 7.2 using x2go, XQuartz 2.7.11 and XFCE). Though it's working a little differently for me. At the start of a session, it works just fine, then it doesn't. I don't get the sync working again by disabling it and re-enabling it. I have to pause the session and reconnect.

Interesting thing is copy/paste won't work even within the remote apps let alone syncing with mac. But say I disable syncing in x11 settings, then copy/paste works just fine.

I also randomly get loss of focus of the x11 window as I'm working. I have to click again to get focus back again. Might be a separate issue.
Comment 14 TerabyteDragon 2017-07-31 19:19:52 UTC
I am also seeing this issue.  Sometimes leaving an xterm window open in the background helps (I normally use SSH/iTerm2), not sure if that's relevant.
Comment 15 TerabyteDragon 2017-09-12 19:24:24 UTC
I'm experiencing the issue exactly as described by:

Seems like this was never corrected.
Comment 16 Jeremy Huddleston Sequoia 2017-09-12 20:36:03 UTC
Yes, that issue was closed as cannot reproduce, mainly because the originator never responded to requests for data.

Now, while there seem to be folks willing to provide data, there is nobody actually working on this codebase, so it's unlikely to ever get fixed unless someone decides to work on it.
Comment 17 Hanxiao He 2017-11-18 18:49:01 UTC
This issue is mainly caused by the option you used in xsel and xclip.

I guess you may use $(xsel -b) or $(xclip -selection clipboard) to copy stuffs.

The way to solve the problem is to omit -b option for xsel or -selection clipboard for xclip, and in that way, Xquarze will work properly

Check the command below:
$ echo "hello, xsel" | xsel -i

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.