pash: Use brace group instead of subshell and send /dev/null to clipboard manager

This commit is contained in:
Dylan Araps 2019-11-30 10:41:33 +00:00
parent 05be033cd6
commit 34d1e4484a
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

6
pash
View File

@ -68,10 +68,10 @@ pw_copy() {
# #
# If the 'sleep' fails, kill the script. This is the # If the 'sleep' fails, kill the script. This is the
# simplest method of aborting from a subshell. # simplest method of aborting from a subshell.
( {
sleep "$PASH_TIMEOUT" || kill 0 sleep "$PASH_TIMEOUT" || kill 0
printf '' | $PASH_CLIP $PASH_CLIP </dev/null
) & } &
pw_show "$1" | $PASH_CLIP pw_show "$1" | $PASH_CLIP
} }