XTerm*VT100*selectToClipboard: true

The Problem

Working with copying text between applications which use the X11 PRIMARY (eg. the quick-copy of selected text and pasting by clicking the middle mouse button) and those which use the CLIPBOARD (eg. usually GUI applications using Ctrl-C to copy and Ctrl-V to paste). The CLIPBOARD is also the buffer used (for example) when web browser javascript automatically copies selected text (which is frequently a hassle because it is added to make difficult to select text easy to copy, but it is not then available to middle-click paste into a terminal).

For more detailed information see the X11 documentation.

An easy solution

Probably the most common application that is being used that uses X11 PRIMARY by default is xterm.

This can be configured to copy/paste using the CLIPBOARD instead with by adding this to your $HOME/.Xresources file:

XTerm*VT100*selectToClipboard: true

This will be automatically loaded next time you log in, but the changes can be tested and loaded into your current X session using xrdb in merge mode:

xrdb -merge $HOME/.Xresources

Getting used to the change

After making this change note that selected text in GUIs which used to select into PRIMARY may now need a Ctrl-C to copy the text into CLIPBOARD (but once this is done middle-clicking into a terminal will now work).

Leave a Reply

Your email address will not be published. Required fields are marked *