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.

I've encountered what I can best describe as "unpredictable" behaviour of the "clipboard".
.. but in it's own way, it actually is "predictable"", as it is not an X bug, as such.
It largely results from different X applications using different X features in different ways...

But it doesn't really help to know that it isn't "actually" a bug. becase it feels like a bug!

There is a list (below) of what I've found / tested.

Is there some way (a daemon?), which irons out all these wrinkles?
I'd prefer something that doesn't sit in the panel.

The X / Ubuntu clipboard is potentially awsome, because of its 2/3 levels ability, but is a bit annoying because of the inconsinstant implememtations...

I've been trying to understand why the copy/paste thing didn't always do what I expected... It's amazing what you can learn when you read the info docs :) .. but a question can hit the target faster.

The main issue seems to come about when the source application is shut down, and you try to access "clipboard" data which came from that app.

X GUI applicatons have 2 major copy/paste methods (modes).

Mode NAME    Text Copy method         Text Paste  method  
----------   ---------------------    -------------------  
PRIMARY      currently selected       mouse middle-click  
CLIPBOARD    Control+C selection      Control+V  

I've tested the behaviour of the selection modes for a few different X apps.
... gvim, gedit, firefox, gnome-terminal

NB: All pasting was done into gedit...
... The gedit source was from another (root) instance)
... I've tried a couple of "managers" .. parcelite and pastie.
... ... but can't see any point in comparing them, because neither address the problem.
... ... ie: normally expected copy / paste keyboard actions are "inconsistant"

+ --------------------------------------------- + ------------------------------------------- + ------------ 
| Modes used in the source Application          | Availability upon CLOSING the Applicaton    | Application
+ --------------------------------------------- + ------------------------------------------- + ------------
| --- no manager --- 
| PRIMARY only, no CLIPBOARD Copy/Cut used:     | PRIMARY Empty!   (previous)CLIPBOARD ok     | (all tested)
|                                               | --                                          |      
| CLIPBOARD as last action (implicit PRIMARY):  | PRIMARY Empty!             CLIPBOARD Empty! | gvim
|                                               | PRIMARY Empty!             CLIPBOARD ok     | gedit, gnome-terminal
|                                               | PRIMARY Empty!             CLIPBOARD Empty! | firefox
|                                               | --                                          |
| PRIMARY as last action, preceded by CLIPBOARD | PRIMARY ok                 CLIPBOARD Empty! | gvim
|                                               | PRIMARY Empty!             CLIPBOARD ok     | gedit, gnome-terminal
|                                               | PRIMARY Empty!             CLIPBOARD Empty! | firefox
| --- manager: parcelite --- 
| PRIMARY only, no CLIPBOARD Copy/Cut used:     | PRIMARY ok       (previous)CLIPBOARD ok     | (all tested)
|                                               | --                                          |      
| CLIPBOARD as last action (implicit PRIMARY):  | PRIMARY ok                 CLIPBOARD Empty! | gvim, firefox
|                                               | PRIMARY ok                 CLIPBOARD ok     | gedit, gnome-terminal
|                                               | --                                          |      
| PRIMARY as last action, preceded by CLIPBOARD | PRIMARY ok                 CLIPBOARD Empty! | gvim, firefox
|                                               | PRIMARY ok                 CLIPBOARD ok     | gedit, gnome-terminal
| 
+ --------------------------------------------- + ------------------------------------------- + ------------
share|improve this question
add comment

3 Answers 3

up vote 4 down vote accepted

That is a known limitation of X, please refer to this article of the official wiki:

https://wiki.ubuntu.com/ClipboardPersistence

The main issue remains the inconsistency between applications that may use different approach to clipboard handling.

In the wiki article there are listed working and not working application ( also the only workaround proposed is to install parcelite as clipboard manager )

share|improve this answer
    
Thanks OpenNingia.. The wiki is helpful. I'm quite new to Linux so I was a puzzled by it! but now that I am aware of it (VERY aware! after testing those app myself)..well, now I'll be more alert to the "quit syndrome"... Having the wiki list is great; I didn't fancy much more "testing" :( ... I'll try running without parcelite. The fewer ancillary apps the better (for me)... I survived umpteen years of Windows with no recycle bin; I think I can manage the clipboard (now that I know how the selection modes work) ...its just a habit (like crossing the road). –  Peter.O Nov 8 '10 at 9:55
    
Let's hope for the better, when Ubuntu will switch to Wayland hopefully they address the problem! :) –  OpenNingia Nov 8 '10 at 11:11
    
Parcellite didn't fix empty-on-exit for me, I still had to delve into its clipboard history manually to extract what I wanted. Ugh. I wish Mozilla would just implement the ClipboardManager standard. –  bobince Nov 9 '10 at 3:11
    
It's probably a xulrunner deficiency, I cannot think of any workaround. –  OpenNingia Nov 9 '10 at 12:30
    
@bobince. I suspect (based on my recent research) that the reason "parcelite" doesn't fix it, is bceause it can't... It can only keep copies of what passes through the X-selections (PRIMARY-selection, and CLIPBOAD-selection)... "parcelite" never puts anything into either of the X-selections. This is the fundamental problem (see OpenNingia's link)... Different applications follow different standards, but "Google Summer Of Code 2010" is looking at ways to tidy this up... so things are happening... (Ubuntu is moving away from X itself!. that'll change the clipboard state of affairs. –  Peter.O Nov 9 '10 at 21:21
add comment

I was just looking at gpaste which is what i use it seems to handle copy and paste actions even if you have closed the application you copied from! there is even a nice extension for Gnome-shell :-)

share|improve this answer
add comment

Try autocutsel, in repos - it syncs the two. You have to add it to .bashrc or startup aps, or just start it manually (it is command line, not gui) but it has always worked well for me. You do have to remember to switch the focus to the field (if browser, for example) or document (gedit, kate, gvim...) before pasting or it will appear to not work.

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.