Cut & paste between X and Mac applications

After the last system update of Mac OS X 10.5.7, cut & paste didn't work anymore between Mac applications and X11 programs. The pasteboard of the Mac and the clipboard of X were no longer synchronized. It turns out this is a preference that can be set in the Xquartz X server, by using the defaults command. (See man Xquartz for details.)

This is what I did to make cut & paste work again:

defaults write org.x.X11 sync_pasteboard 1
defaults write org.x.X11 sync_pasteboard_to_clipboard 1
defaults write org.x.X11 sync_pasteboard_to_primary 1
defaults write org.x.X11 sync_clipboard_to_pasteboard 1

and then restart X11. (It is normally not recommended to use defaults to change defaults of a running program, because the program might override the defaults when it exits; but Xquartz doesn't seem to do that.)

Another effect of the latest update is that enabling key equivalents in the X11 preferences does not enable the ⌘~ (Apple + tilde) combination to switch windows. Instead, it enables ⌘→ (Apple + right arrow). If you want ⌘~, you'll have to disable key equivalents.

I decided to disable key equivalents as a result. It is bad enough that the Mac GUI forces you to think hard to get the right combination of ⌘Tab and ⌘~ to switch between windows; it's just too difficult if on top of that you need to remember to use ⌘→ instead of ⌘~ if the target window is under X11.

Bert Bos
Created 17 May 2009