Hi,

I am guessing I'm using pass a bit differently than most, and keep
something more like "information cards" than simple passwords in each
file. For this reason I only show the content.

In an environment where my terminals may be viewed by others, I would
prefer to not having my passwords listed in the scrollback buffer. The
easy solution to this is to pipe the command through a pager like
'less'. However, it would be better if this would be automatic and I
have patched the pass script to make use of the $PAGER variable - if it
exists and contain something sensible.

This might be interesting to more than me, so I attach the patch in the
hope it, or some version of it, makes it into the official version. :-)


-Are
--- password-store.sh.orig  2015-01-19 13:39:04.305636685 +0100
+++ password-store.sh   2015-01-19 13:41:15.961637409 +0100
@@ -311,7 +311,11 @@
    check_sneaky_paths "$path"
    if [[ -f $passfile ]]; then
        if [[ $clip -eq 0 ]]; then
-           exec $GPG -d "${GPG_OPTS[@]}" "$passfile"
+           if [ -n "${PAGER}" -a $(which ${PAGER}|wc -l) -eq 1 ]; then
+               exec $GPG -d "${GPG_OPTS[@]}" "$passfile" | ${PAGER}
+           else
+               exec $GPG -d "${GPG_OPTS[@]}" "$passfile"
+           fi
        else
            local pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | head -n 1)"
            [[ -n $pass ]] || exit 1

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Password-Store mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to