views:

88

answers:

3

I want to make gnome-terminal behave in such a way that when the end user selects a region on the terminal (with a mouse or mouse key), it gets automatically copied into the clipboard. Is it possible at all? If so, how?

+3  A: 

It should be in the X11 clipboard. (Not the same as the GTK clipboard). Press middle-click to paste.

unutbu
gnome-terminal often fails to copy the selection. that's why i wanted it to be robust enough so that *every* time i select some text, it gets copied into the clipboard. i know about the middle-click pasting.
OTZ
to be even more exact: i want to omit the right-click > "Copy" movements when i select a text to copy it to the clipboard.
OTZ
A: 

As you seem to be coming from a Windows environment I hope you are aware that the way copying and pasting works under X is a bit different from how it works under Windows. If not, for a quick introduction see Jamie Zawinski's excellent article on this subject matter X Selections, Cut Buffers, and Kill Rings.

In short: when you select some text this becomes the Primary selection (not the Clipboard selection). As others have pointed out you can paste from the Primary selection using the middle mouse button. Note however that if you close the application offering the selection, in your case the terminal, the selection is essentially "lost".

You can also use Shift+Ctrl+C in Gnome Terminal to explicitly "copy" something.

Bruce van der Kooij
If only gnome-terminal actually worked that way.
meowsqueak
A: 

"Not possible" is the answer.

OTZ