I am developing a GTK based application which has to support clipboard. For that I am exporting selection data using gtk_clipboard_set_with_data
with the target formats: UTF8_STRING
, STRING
, TEXT
, COMPOUND_TEXT
, text/plain
, text/plain;charset=utf-8
, text/rtf
, text/html
and text/url
. Using this I am able to copy-paste text from my aplication to other text editors like gedit. However, I am not able to paste text to XTerm. Should I be exporting to any other target? Where can I get a list of formats accepted by XTerm?
Asked
Active
Viewed 2,005 times
3

341008
- 9,862
- 11
- 52
- 84
1 Answers
2
xterm only uses the PRIMARY
selection buffer, so you should probably add that to your list.
See http://www.davidsimmons.com/soft/xtermhacks/#copynpaste and http://www.freedesktop.org/wiki/Specifications/ClipboardsWiki for more information.

schot
- 10,958
- 2
- 46
- 71
-
Does this mean that all other application (e.g., firefox) from which I can copy-paste to xterm use both `PRIMARY` and `CLIPBOARD` buffers? Will there be any side effects if I use both `PRIMARY` and `CLIPBOARD` buffers simultaneously? What I understood is that even if I use `PRIMARY` on Ctrl-C, it will be overwritten if user selects some text before pasting on XTerm. – 341008 Jul 22 '10 at 07:51
-
Yes, I believe you are right. But xterm users should be used to that, since that is the only way to copy-paste with this archaic program (I use it myself). – schot Jul 22 '10 at 07:54
-
What about Gnome Terminals then? They support copy-paste. That means they use `CLIPBOARD`, right? But I can't paste to them either. Sorry for coming up with so many questions. Just don't know where else to turn. – 341008 Jul 22 '10 at 08:03
-
Don't know about Gnome Terminal but apparently is suffered from the same problem: http://cafbit.com/entry/gnome_terminal_friendly_clipboard_patch – schot Jul 22 '10 at 08:17