Well, it turned out to be xsel's problem - it corrupts the clipboard the same way when called manually.
Well, it turned out to be xsel's problem - it corrupts the clipboard the same way when called manually.