[PATCH] Close stdout for background task that restores clipboard

Allan Odgaard lists+pass at simplit.com
Thu Sep 14 14:36:38 CEST 2017


While we do not expect any output on stdout from the background task, 
keeping the file handle open means that anyone calling `pass` and 
waiting for stdout to be closed, will have to wait (by default) for 45 
seconds.
---
  src/password-store.sh  | 2 +-
  src/platform/cygwin.sh | 2 +-
  src/platform/darwin.sh | 2 +-
  3 files changed, 3 insertions(+), 3 deletions(-)

diff --git src/password-store.sh src/password-store.sh
index d77ff12..9008e05 100755
--- src/password-store.sh
+++ src/password-store.sh
@@ -173,7 +173,7 @@ clip() {
  		qdbus org.kde.klipper /klipper 
org.kde.klipper.klipper.clearClipboardHistory &>/dev/null

  		echo "$before" | base64 -d | xclip -selection "$X_SELECTION"
-	) 2>/dev/null & disown
+	) &>/dev/null & disown
  	echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
  }

diff --git src/platform/cygwin.sh src/platform/cygwin.sh
index 6e5dd86..eb05e3f 100644
--- src/platform/cygwin.sh
+++ src/platform/cygwin.sh
@@ -11,7 +11,7 @@ clip() {
  		local now="$(base64 < /dev/clipboard)"
  		[[ $now != $(echo -n "$1" | base64) ]] && before="$now"
  		echo "$before" | base64 -d > /dev/clipboard
-	) 2>/dev/null & disown
+	) &>/dev/null & disown
  	echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
  }

diff --git src/platform/darwin.sh src/platform/darwin.sh
index 86eb325..1281b74 100644
--- src/platform/darwin.sh
+++ src/platform/darwin.sh
@@ -11,7 +11,7 @@ clip() {
  		local now="$(pbpaste | openssl base64)"
  		[[ $now != $(echo -n "$1" | openssl base64) ]] && before="$now"
  		echo "$before" | openssl base64 -d | pbcopy
-	) 2>/dev/null & disown
+	) &>/dev/null & disown
  	echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
  }

-- 
2.14.1



More information about the Password-Store mailing list