If I use e.g.
echo 'test' | xclip -i -selection primary -loops 1 -quiet
and paste into another terminal window, it works as expected, i.e. 'test' is pasted and then the primary selection goes back to the previous client, 'test' is gone. However, if I paste into an X program, this does not work. If I use -loops 10
, I can see that 'test' is pasted to the application on the fourth loop in e.g. gedit and a webkit browser, in firefox it is even the seventh loop. If I use xsel
instead, I get the following behaviour:
echo 'test' | xsel -i -p -n -vvvv
xsel: Window id: 0x2e00001 (unmapped)
xsel: Timestamp: 2495171514
xsel: Maximum request size: 4000 bytes
xsel: Accumulated 5 bytes input
xsel: handle_selection_request, property=0x1ca (<unknown atom>), target=0x23d (<unknown atom>)
xsel: Refusing conversion
xsel: handle_selection_request, property=0x1ca (<unknown atom>), target=0x1a9 (TARGETS)
xsel: change_property ()
xsel: data within maximum request size
xsel: Confirming conversion
xsel: handle_selection_request, property=0x1ca (<unknown atom>), target=0x121 (UTF8_STRING)
xsel: change_property ()
xsel: data within maximum request size
xsel: Confirming conversion
The same happens if I use clipboard
instead of primary
. What happens in the first few loops and where does the data go?
Note: This is of interest since in password managers, you may want to paste the password exactly once...
Another note: I remember that this used to work at some point in the past, probably on an old Ubuntu version. Now I can reproduce this behaviour on Ubuntu 12.04 and also on Debian testing.