wl-clipboard icon indicating copy to clipboard operation
wl-clipboard copied to clipboard

Close stderr before forking wl-copy

Open tomKPZ opened this issue 2 years ago • 3 comments

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.

tomKPZ avatar Jan 03 '23 03:01 tomKPZ

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.

bugaevc avatar Jan 03 '23 04:01 bugaevc

Use

echo asdf | kitty +kitten clipboard

instead, when running inside kitty. There is no need to use WM specific tools for copying to clipboard.

kovidgoyal avatar Jan 04 '23 08:01 kovidgoyal

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.

lilydjwg avatar Jan 21 '24 07:01 lilydjwg