wl-clipboard
wl-clipboard copied to clipboard
Close stderr before forking wl-copy
The default mode of the kitty terminal is to wait until output from all subprocesses is finished before closing. This means running wl-copy asdf; exit will exit the shell but cause kitty to hang as it waits for wl-copy to output. This change closes stderr to prevent this issue.
Hi!
This has been proposed before (see https://github.com/bugaevc/wl-clipboard/pull/110), and I'm still not convinced this is a good idea.
Use
echo asdf | kitty +kitten clipboard
instead, when running inside kitty. There is no need to use WM specific tools for copying to clipboard.
Not closing stderr will leave a ssh command having called wl-copy to hang there until something else has copied.
Also, doing a 2>/dev/null redirection is awkward because it has to be quoted on the ssh command line, which prevents code highlight and shell-word movements.