I made the following comments:
$ xclip text.txt
Execution stops immediately, it copies the contents of text.txt by default to XA_PRIMARY , which means that you can paste it through the middle mouse button or xclip -o .
When I want to see what xclip does, it no longer ends:
$ xclip -verbose text.txt Connected to X server. Using UTF8_STRING. Reading text.txt... Waiting for selection requests, Control-C to quit Waiting for selection request number 1
It does not end until I select something in my X11 system, for example, this very output that I inserted here. I would understand this if the behavior is limited to verbose . In the end, you want to sit down and see what happens.
I can reproduce the same behavior with strace , but only if fork parameter is provided
$ strace -f xclip text.txt
or when shelling from Ruby using a system execution command that should return a result, which is actually nothing.
$ ruby -e "`xclip text.txt`"
The hint strace gave is that it is polling in a file descriptor to wait for an event. This event is fired if I choose something. Is this behavior explicable? I have evidence that this is not reproducible in any system. Could this be due to ticket # 9 Do not close stdout when configuring the clipboard from stdin ?
I am running xclip version 0.12 on Ubuntu 13.04.
linux unix ubuntu x11 xclip
Konrad reiche
source share