Hello,I noticed that when using the -c option, some passwords with certain sequences of special characters would cause a pipe fail in the tail command. Attached is a git formatted patch that has resolved the issue for me. Hopefully this might help someone else too.
Maxwell Kapral
From e285db12f71b3d1371e9881e260f1459592cda74 Mon Sep 17 00:00:00 2001 From: Maxwell Kapral <[email protected]> Date: Thu, 2 Feb 2023 22:45:26 -0800 Subject: [PATCH] prevent pipefail with tail when copying some passwords To: [email protected] --- src/password-store.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/password-store.sh b/src/password-store.sh index 22e818f..c723b67 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -388,7 +388,7 @@ cmd_show() { echo "$pass" | $BASE64 -d else [[ $selected_line =~ ^[0-9]+$ ]] || die "Clip location '$selected_line' is not a number." - pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | tail -n +${selected_line} | head -n 1)" || exit $? + pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -${selected_line} | tail +${selected_line})" || exit $? [[ -n $pass ]] || die "There is no password to put on the clipboard at line ${selected_line}." if [[ $clip -eq 1 ]]; then clip "$pass" "$path" -- 2.39.1
