I am having issues with the Gnome(/Linux/Debian+Ubuntu) clipboard when connected remotely; it's default behavior appears to be to automatically add text to a clipboard buffer when that text is selected. This is not usually a problem, until I need to log into one of these systems remotely (w/ GUI), and attempt to use a shared clipboard. If I 'copy' text on the local machine (destined to replace some text on the remote machine), that copy buffer is overwritten as soon as I select the text on the remote machine to be replaced.

Is there some way around this? It sort of drives me nuts.


UPDATE: This is really an NX server issue; X11 supports multiple clipboards ("selections": clipboard, primary. secondary; see this excellent article) that behave differently, and it appears that my problem is related to how NX server translates this over to the host machine.


X11's clipboard system is implemented using three types of "selections": 'primary', 'secondary', and 'clipboard'. 'Clipboard' is used for "Copy/Paste" menus and ctrl+c/v, and primary is used for mouse selection and middle mouse button paste; 'secondary' is a little used area, as a backup for 'primary'.

The freedesktop.org clipboard specification explains the following about the PRIMARY selection:

1.It's inconsistent with Mac/Windows;
2.It's confusingly. Selecting anything overwrites the clipboard;

So, it appears that because the Primary selection overwrites the Clipboard selection, you can never effectively overwrite a block of text on the remote machine with a block of text selected from the host machine (once the second selection is made (into the primary), it overwrites the first selection (in the clipboard)).

The answer to the question is probably "No", unless the linked specs are outdated (they are from 2001), or there is some override to this behavior that I couldn't find.

  • 1
    At least on CentOS (and I believe most other graphic Linux I have worked with), setting Primary does not overwrite Clipboard. In other words, I can select some text, copy, select some other text (overwriting Primary), and paste the first text from Clipboard. The issue that you talk about (that I also have) is that NX seems to be taking the value of the local clipboard, putting it in Primary, and making Clipboard somehow point to it as well. When you select something on the remote machine, Primary is set to the new value and Clipboard is cleared. – Konstantin Tarashchanskiy Dec 8 '11 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.