[pass] [Patch] Added option to hide password output

Kjetil Torgrim Homme kjetil.homme at redpill-linpro.com
Mon Nov 23 19:03:04 CET 2015


On 11/21/2015 01:10 AM, Michael Clemens wrote:
> when using pass via ssh on a remote system, I cannot make use of the
> clipboard feature. In order to output the password without actually
> displaying it, I wrote the following patch which prints the password in
> red on a red background while still being able to be manually copied to
> the clipboard:

that's a very clever idea :-)

for more portability (and readability), use "tput setaf 1; tput setab 1"
and "tput sgr0" to revert to default colours.

(yes, I know there are more hardcoded escape sequences in pass, but...)

>          if [[ $clip -eq 0 ]]; then
> -            $GPG -d "${GPG_OPTS[@]}" "$passfile" || exit $?
> +            if [[ $hidden -eq 0 ]]; then
> +                $GPG -d "${GPG_OPTS[@]}" "$passfile" || exit $?
> +                       else
> +                local pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -n 1)"
> +                [[ -n $pass ]] || exit 1
> +                               echo -e "\e[0;31;41m$pass\e[0m"
> +                       fi
>          else
>              local pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -n 1)"
>              [[ -n $pass ]] || exit 1

there is something strange with your tab-width, it looks like.

-- 
Kjetil T. Homme
Redpill Linpro - Changing the game

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20151123/0bef7279/attachment.asc>


More information about the Password-Store mailing list