Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I copy something from another window then my terminal and want to paste it into my terminal (on the command line) the paste option in Edit is grayed out. Ctrl+V does not work in GNOME Terminal 2.29.6.

I try to copy form netbeans into a terminal. If I paste it somewhere else, in gedit for example, it gets pasted. So it is copied.

Using Ctrl+Shift+C/V does not work.

Is this a settings of from some sort?

share|improve this question
    
What terminal application are you using? Gnome-Terminal or another variety? –  Marco Ceppi Sep 3 '10 at 19:02
    
Just a gnome terminal: GNOME Terminal 2.29.6 Ubuntu 10.04 clean install (not an upgrade from 9.10) –  eddy147 Sep 4 '10 at 8:26
    
The strange thing is, I only have this at home laptop. (sony vaio - fresh 10.04 install). At work (dell - also fresh 10.04 install) no problem. –  eddy147 Sep 6 '10 at 7:54
add comment

12 Answers 12

up vote 15 down vote accepted

I have the same problem with copying from Netbeans to terminal. It seems that when you Ctrl+C in Netbeans, it isn't copied in pure text format, so you can't paste it in terminal which require that kind of format (this is an assumption based on my experience ;) ).

So, how do I do it? Just copy from Netbeans, then paste it in some text editior, on example gedit, then copy it again and just paste in terminal.

share|improve this answer
    
The other answers below, currently with less votes, are easier. For example, just use middle click (as per user10244) or see here: askubuntu.com/questions/7769/… –  MountainX Apr 17 '12 at 19:18
add comment

You need to append a Shift when pasting into the Terminal: Ctrl+Shift+V Same with copying a selection only using a C instead:

Ctrl+Shift+C

Shift is the escape sequence for shortcuts when using the Gnome Terminal.

Alternatively you can Right Click->Paste

share|improve this answer
3  
Sounds logically, but this case it doesn't work. See my other comments. –  eddy147 Sep 4 '10 at 8:27
    
You can configure your key bindings in your gnome terminal (Edit -> Keyboard shortcuts ..) and make sure that Shift-Ctrl-C and Shift-Ctrl-V are bound (or whatever you like) –  ithkuil Sep 5 '10 at 22:17
add comment

Ctrl+V is not a bound combination in terminals. The terminal application ignores the keyboard event and passes it onto whatever's running. This is desirable because you don't really want the terminal window interfering with your keyboard events.

Right-click and click paste. Or use Primary Selection (highlight some text and middle-click).

Edit: I've just learned something! Shift+Insert will work if you want a keyboard input method. It's a primary-selection-based insert method, so just highlight and go.

Edit 2: I can't stop learning new things! As ændrük says, Ctrl+Shift+V works as a proper clipboard paste. So you've got lots of options. They're just not the standard key-combos.

share|improve this answer
1  
+1 for shift+insert. It works pretty much anywhere, and is my preferred way to paste. It'll paste the last thing in either of your clipboards (ie: if you highlighted something, it'll paste that, otherwise, it pastes the last thing you copied) –  aperson Sep 3 '10 at 19:29
    
Actually, Ctrl+V is bound in the nano terminal editor. –  CoderMe Oct 26 '13 at 14:47
add comment

tldr- use Shift+Insert


Ctrl+C and Ctrl+V were keyboard shortcuts created for GUI applications. Apparently has something to do with Xerox.


Before there was Ctrl+C, Ctrl+X, and Ctrl+V.. there was


Ctrl+Insert, Shift+Delete, and Shift+Insert

They were defined in 1987 by the IBM Common User Access

These shortcuts often work in cases where the modern ones do not.. ie, in a terminal.

share|improve this answer
    
+1 for Xerox :) –  DarkCthulhu Sep 20 '12 at 17:07
add comment

Oli and user1974 suggested using Primary Selection (an X-Windows feature), but I needed these details to do so:

1.) Highlight text in NetBeans (don't worry about copying it)

2.) Middle-click in GNOME Terminal to paste it there

No other suggestions worked for me, but this worked like a charm. There is a bug entered at netbeans.org for this.

share|improve this answer
    
Good answer. Here are a few more ways to do it: askubuntu.com/questions/7769/… –  MountainX Apr 17 '12 at 19:15
    
Works for me, thanks! –  ChocoDeveloper Aug 5 '12 at 9:35
add comment

Copy text by highlighting it with your mouse. Usually you can use Ctl+C or right click the selection select "copy" from the popup menu as well.

Paste text by clicking your middle mouse button. Ctl+V also works in many places and so does Shift+Insert.

What to do when that doesn't work

The problem occurs when different applications use different clipboards. You will successfully copy the text to a clipboard in Application A, but when you go to Application B to paste, it will try paste from a different clipboard. In Windows all applications use the same clipboard.

There are several solutions. Probably the easiest one to get working is to install Parcellite.

Install parcellite

sudo apt-get install parcellite

Run parcellite

parcellite&

A clipboard icon will show up in the system tray.

Use parcellite

  1. Copy some text.
  2. Click the clipboard icon in the system tray and select what you want from the menu.
  3. Paste your text.
share|improve this answer
add comment

There is a bug in Linux that sometimes de-selects copied information when trying to copy/paste between 2 different applications. I recommend installing a clipboard manager, then you will see this bug in action. Parcellite is my favorite. If you are using Debian/Ubuntu paste "sudo apt-get install parcellite" (no quotes) into a terminal (ha,ha) or use Synaptic to install it. This bug affects all programs, not just the terminal.

After you install and start Parcellite (Applications -> Accessories -> Parcellite) you will see a clipboard icon in your systray. Recreate the bug, and then click the tray icon. You will see that the info was copied but is grayed-out, i.e., not selected. Click it to select it and then you can paste to your heart's content. This is one of the most annoying bugs of all time and has been around for years.

share|improve this answer
    
nice suggestion, thx –  eddy147 Sep 6 '10 at 7:52
    
It is a long term annoying problem. And it's intermittent. Sometimes paste works when it feels like it; other times is doesn't. Those kinds of bugs with selective biting are the most infuriating. –  ncmathsadist Nov 16 '11 at 15:10
    
It's funny...it still happens using GNOME 3 with GNOME Shell. I'm lead to believe that it's really an Xserver problem (happens in KDE too!). I wish it would get fixed already :) –  Deadite81 Nov 17 '11 at 0:27
add comment

It's a bug in gnome-terminal. You can try xfce4-terminal.

share|improve this answer
    
Thx for the alternative –  eddy147 Jun 27 '11 at 10:35
    
This is the best solution I found. Thanks. –  tony-p-lee Dec 28 '12 at 18:41
add comment

It sounds like the text was not actually copied in the first place. If there is anything available to paste on the clipboard, then Edit -> Paste will be clickable.

In Gnome Terminal, the keyboard shortcut for pasting is usually Ctrl+Shift+V.

share|improve this answer
    
I thought so too, but it is copied. I try to copy form netbeans into a terminal. If I paste it somewhere else, in gedit for example, it gets pasted. So it is copied. –  eddy147 Sep 3 '10 at 17:14
add comment

I had this same problem with Rubymine, where I was unable to copy from Rubymine and paste into terminal with CTRL-SHIFT-V. Given that I do this tens of times daily, I had little interest in copying to gedit every time and then copying to terminal, so I figured out a solution that doesn't require it:

http://www.williambharding.com/blog/technology/fix-it-ubuntu-ctrl-shift-v-wont-paste-into-terminal/

Short story: OpenJDK doesn't play nice with the clipboard. I am guessing that this would apply to Netbeans as well as Rubymine since both run via a Java VM.

share|improve this answer
1  
PhpStorm - same story. This is an openjdk issue. Moving to sun java resolved the problem. –  Dziamid Mar 13 '13 at 10:06
    
@Dziamid thanks for the alternative to the horrible workarounds mentioned elsewhere in these answers. –  nem75 May 10 '13 at 8:05
    
@wbharding you might want to consider putting "switch to Sun Java" in your answer. I for one didn't bother reading the link but got the solution from Dziamid's comment. Might get you more upvotes. –  nem75 May 10 '13 at 8:07
add comment

You can also change the system default keymappings - so you can ctrl+v into terminal.

Edit->Keyboard Shortcuts

share|improve this answer
    
This is the correct answer! Edit->Keyboard, and change the settings! bingo! –  IanVaughan Apr 12 '12 at 17:57
    
If you do this, you should also consider remapping the intr (formerly CTRL-C) command. I use echo "stty intr \^b" >> ~/.bashrc where b represents "break" -- or pick any other letter that isn't used on something important. One of the greatest productivity enhancements for me is making this simple change to the default copy and paste shortcuts in the terminal. I do it on all my computers first thing. –  MountainX Apr 17 '12 at 19:12
    
It seems as of Ubuntu 13.04, the shortcut options are no longer there! –  IanVaughan Aug 23 '13 at 18:31
add comment

highlight text, middle click.

That's my favorite, quick, easy, works with other apps too. You just have to be careful with your clicks as you can mess up the highlight. (ie, you can't highlight the text, click around, highlight other text, and then hope to middle click the text from earlier.)

share|improve this answer
add comment

Your Answer

 
discard

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.