bugaevc / wl-clipboard

Command-line copy/paste utilities for Wayland
GNU General Public License v3.0
1.62k stars 59 forks source link

Close stderr before forking wl-copy #154

Open tomKPZ opened 1 year ago

tomKPZ commented 1 year ago

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.

bugaevc commented 1 year ago

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.

kovidgoyal commented 1 year ago

Use

echo asdf | kitty +kitten clipboard

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

lilydjwg commented 10 months ago

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.