echo "stuff" | xsel -b to put "stuff" on my clipboard.
Commonly I use it for output of other commands, e.g.
realpath "./file" | xsel -b
I'm able to directly paste this in some GUI apps (e.g. my browser -- firefox), but not in some other apps (e.g. my IDE, it pastes nothing). But if I paste it in my browser, copy it again from there and try to paste it to my IDE, that seems to work.
What can be an explanation for this?