Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
It totally depends on your DE and terminal. – RobotHumans Jan 9 '13 at 0:47
@AbrahamVanHelpsing: I am using the default-installation, should have said this... – false Jan 9 '13 at 1:05
After selecting, you need to copy, then only can you paste. Just mentioning it because the way the question is written, it appears you want to go straight from select to paste. In other words, select with left-click, copy from the right-click menu, and paste from the right-click menu. – user25656 Jan 9 '13 at 1:42
Are you using XTerm? (the software) or are you referring to Gnome Terminal as XTerm?. – Uri Herrera Jan 9 '13 at 2:01
@vasa1: But after the left-click selection, the right-click paste is still disabled! – false Jan 9 '13 at 2:48

Use middle click or shift+insert

see X Window selection

share|improve this answer
Middle click did not work, nor did Shift-Insert (which I have never heard of, but I tried). E.g., I try to copy-paste something into the text-box I am just writing... – false Jan 9 '13 at 0:52
X has two clipboards if you select something in xterm, it will goto the cut buffers, in which case you can paste with middle click or shift+insert. which is not the same concept as copy an paste. – strings Jan 9 '13 at 0:56
I added a link to help explain the X 11 selection process. – strings Jan 9 '13 at 0:58
Thank you. But how do I now get under unity a text from an xterm into another app. Previously, (I used karmic), I simply used middle click as you suggest. But now, under unity, or 11.04; neither middle-click nor shift-insert works. – false Jan 9 '13 at 1:03
if shift+insert does work either, then we can rule out its your mouse. are you using some clipboard manager. xsel or something like that? – strings Jan 9 '13 at 3:27

A similar issue is discussed here. As "strings" pointed out:

X has two clipboards if you select something in xterm, it will goto the cut buffers, in which case you can paste with middle click or shift+insert. which is not the same concept as copy an paste.

Copy/paste within xterm worked for me but not to an application outside, example gedit. As per the link above, I installed parcellite and that fixed the problem,

sudo apt-get install parcellite

Update: If "paste" does not work with "shift-insert", then use the middle mouse button or if you do not have one click both the left and right buttons simultaneously to paste.

share|improve this answer
+1 for click both buttons to paste. – Chris K Jan 14 '14 at 9:22
For a little more clarity, after installing parcellite, run it. It sits in your system tray. Right-click > Preferences, then check "Use Primary" and "Synchronize clipboards". Now select something in Xterm, and you can then Ctrl-V elsewhere. – Ian Gibbs Dec 12 '15 at 6:41

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.

share|improve this answer

This does not quite answer your question, but it helped me, so am putting it here as it may help someone else:

  1. Copy what you want from xterm by selecting your text
  2. Open a second copy of xterm and your favorite text editor (I use vim)
  3. Use Shift+Insert (or middle-click) to paste into your text editor
  4. Save the file.
  5. If necessary open the file with a graphical text editor (such as gedit)
  6. Copy your text and paste it into the application that you want.
share|improve this answer

When you copy from xterm, just use

shift + middle click

to paste something into gedit or some editor in xterm like mcedit

share|improve this answer

See here for an explanation of paste problems with xterms and modern apps/window managers:

share|improve this answer
Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Eric Carvalho May 21 '13 at 0:13

I have otherwise useful Glipper clipboard manager running on 12.04.
If I select xterm characters, they appear in a new Glipper's entry.
If I select that entry (button) among that succession, the next paste will come from it and paste those characters into any application.

share|improve this answer

When you select text, it's put automatically in the cut buffer (like a clipboard). When you use Copy, from a menu, or with a keyboard shortcut, it goes into the main clipboard.

To paste from the cut buffer into your xterm, middle-click. To paste from the clipboard into your xterm, shift middle-click.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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