14

I've encountered what I can best describe as "unpredictable" behaviour of the "clipboard". But in its 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. because 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 awesome, because of its 2/3 levels ability, but is a bit annoying because of the inconsistent implementations...

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 application.

X GUI applications have two 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 applications: gvim, gedit, firefox, and 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 I can't see any point in comparing them, because neither address the problem. That is, normally expected copy / paste keyboard actions are "inconsistent"

+ --------------------------------------------- + ------------------------------------------- + ------------
| 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
| 
+ --------------------------------------------- + ------------------------------------------- + ------------
1
  • How I wish I could read your whole table at once :-(
    – Don Hatch
    Jun 7, 2019 at 7:59

3 Answers 3

6

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 )

5
  • 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, 2010 at 9:55
  • Let's hope for the better, when Ubuntu will switch to Wayland hopefully they address the problem! :)
    – OpenNingia
    Nov 8, 2010 at 11:11
  • 1
    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, 2010 at 3:11
  • It's probably a xulrunner deficiency, I cannot think of any workaround.
    – OpenNingia
    Nov 9, 2010 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, 2010 at 21:21
1

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.

0

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 :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .