kfish / xsel

A command-line program for getting and setting the contents of the X selection

Home Page:http://www.kfish.org/software/xsel/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`xsel -ib` has no effect when shell script stdout or stderr is closed with `>&-` or `2>&-`

flyxyz123 opened this issue · comments

xsel version 1.2.0
arch linux, 5.15.2-arch1-1

I have a script called test:

#!/bin/sh
echo 'haha' | xsel -ib

If I run test >&- or test 2>&-, string "haha" is not copied to clipboard.

Is it intended? I'm not sure if this is a bug. However, xclip does't have this problem.