How does copy-paste work with xterm?

Left-down-clicking in xterms starts the selection of something to be copy-pasted.

Double-left clicking selects a word.

Triple-left clicking selects a line.

All this works under unity in 11.04. However, there is no way to copy-paste that selection to another place: The right-click menu shows paste disabled, and middle-clicking to copy-paste does not work.

So how can I copy a selection from an xterm into another place? I am happy with any method to perform this.

(I am using the default-installation no special configuration so far)

Edit: Same problem with xedit


Use middle click or Shift + Insert

See X Window selection.


Xterm uses cut buffers, not the standard X11 clipboard selection used for standard copy-paste that gnome-terminal and most other Linux programs now use.

But if you start xterm like this:

xterm -ls -xrm 'XTerm*selectToClipboard: true'&

then selections are available via the standard clipboard.

Read more at Copying and Pasting in Xterm | StarNet Knowledge Database - PC X, X Windows, X 11 & More - StarNet

The xcb program also provides command-line access to the cut buffers.

E.g. in Trusty Tahr 12.04, running lxde window manager, I can triple click on a line of text in xterm, which highlights it and puts it in cut buffer 0. I can then run xcb -p 0 which prints the line out on stdout.

For some reason it didn't work for me to click both buttons (simulating middle click) in an xterm, but shift-insert did work in an xterm.


To copy between xterm and other programs/documents/...

Add to the file ~/.Xresources (or create):

XTerm*selectToClipboard: true

Then run the command:

xrdb -merge ~/.Xresources

Restart xterm.