Right click on the text field the popup mouse menu shows that the clipboard is blank, but when press the wheel in the middle of the mouse the previous selected text is pasted.
Why is this and how can I clear that text?
Gnome 3.6.2 + opensuse 12.3
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
It's because there are actually two clipboards: GNOME has one and X.org has one.
You can paste the text which is on GNOME's clipboard by right clicking an text area and then selecting "paste".
X's clipboard works as the following: when you select text by keeping mouse's left button klicked and move mouse, it is copied to X's clipboard. Then you can paste it by clicking mouse's middle button.
Excerpt from archlinux's wiki page clipboard:
Of the three selections, users should only be concerned with PRIMARY and CLIPBOARD. SECONDARY is only used inconsistently and was intended as an alternate to PRIMARY. Different applications may treat PRIMARY and CLIPBOARD differently; however, there is a degree of consensus that CLIPBOARD should be used for Windows-style clipboard operations, while PRIMARY should exist as a "quick" option, where text can be selected using the mouse or keyboard, then pasted using the middle mouse button (or some emulation of it).
Therefore, the clipboard of GNOME is type CLIPBOARD and the clipboard of X is type PRIMARY.
Excerpt from xclip's man page:
read text into X selection from standard input or files (default)
Therefore, to clear the contents of X clipboard, use the following command:
$ xclip -i /dev/null
$ touch blank $ xclip -selection clipboard blank