GNOME Bugzilla – Bug 143544
gnome-terminal mouse selection overwrites explicit "Edit->Copy"
Last modified: 2005-07-26 19:08:52 UTC
1) Select something with the mouse in a gnome terminal 2) Explicitly choose Edit->Copy or contextMenu->Copy 3) Paste into another app (I used gedit) using Edit-Paste or contextMenu->paste This should paste what you think you're copying. 4) Now select something else in the gnome-terminal window but do not explicitly copy. 5) Paste into the gedit window using edit->paste or contextMenu->paste. It will paste the Primary X selection to be pasted instead of the Clipboard's contents.
Indeed. I wonder why no one say this before... This is happening in vte, so I'll move it. Nalin, This is due to the fact that vte terminals have only one pvt->selection: if I select some text, and do an explicit copy, the text gets copied into terminal->pvt->selection and vte_terminal_copy_cb will take it from there when the selection gets requested. But if now I select something else but without an explicit copy, vte_terminal_button_release will call vte_terminal_copy(terminal, GDK_SELECTION_PRIMARY) which will overwrite terminal->pvt->selection, so that if vte_terminal_copy_cb gets called now in a request for the CLIPBOARD, it'll send the PRIMARY... (If you run xclipboard while you do all this, you won't see this, because it'll be getting the CLIPBOARD so that when you get it you don't get it from terminal->pvt->selection but from it's own cache) Not terribly hard to fix, I guess...
*** Bug 147370 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of 123844 ***