Ubuntu – Gedit clears contents of clipboard on exit – how to keep it

clipboardgeditkate

Use case:

  1. I'm writing an email, and need a snippet from a text file.
  2. Open the file in Gedit (or Kate, for that matter) and copy the desired snippet.
  3. Close text editor, return to email.
  4. Paste snippet into email — oh wait! Nothing is pasted, apparently because closing the text editor causes the clipboard to empty. Not my intention!

What does work:

4b. Return to email, paste snippet, back to editor, close editor.

I can't figure out if there is a way to prevent Gedit (and/or Kate) from clearing the clipboard, or how else to avoid step 4b which seems a rather roundabout way to work around an unintuitive behaviour.

Help?

PS. Apologies, I know that this is not directly related to Ubuntu, but my Google-fu is weak and I don't know where else I'll find an expertly answer (or any answer at all, seriously, how do you search for something like that?). Right now, I'm on Linux Mint 11 LXDE, but I've suffered from the same on stock Ubuntu and Kubuntu as well.

PPS. To me this behaviour seems very unnatural, but I see it here and there in Linux: also in the KDE screenshot tool (substitute "image" for "snippet" and "image editor" for "email"). Is it really just me?

Best Answer

The Ubuntu wiki on Clipboard Persistence suggests that what I'm seeing is a bug but at the same time the intended behaviour. I am now using Parcellite to make things work for me. Thank you for your suggestion.