[pass] Patch for adding a multiclip option

Matthew Cengia mattcen at gmail.com
Fri Feb 14 03:03:42 CET 2014


On 2014-02-13 20:02, Von Welch wrote:
> Hi,
> 
>  I'm said author of the -tail. I'll just add one thing about --tail to what
> Jonas and Philip have said and that it works intelligently with -c, so '-t'
> along doesn't put anything to the paste buffer but '-c -t' does. That's
> logic much easier to add inside of password store than outside of it (and
> yes, for those not running an agent, I do it with only one decryption).
> 
>  As a side note, I'm always loath to run 'pass' without -c because I'm not
> convinced I can actually clear my screen well enough being that I'm running
> in tmux inside of iTerm, and just too many things that can cache my output.
> Putting passwords to stdout is last resort for me.

Hi Von,

That all makes sense, thanks for the info.

I see 2 problems with your code, specifically line 221:

1.  It doesn't handle passwords that contain a backslash, because you're
    not using read -r:

      $ read pass <<<'9g+:em3b\Vixp:PK'
      $ echo "$pass"
      9g+:em3bVixp:PK
      $ read -r pass <<<'9g+:em3b\Vixp:PK'
      $ echo "$pass"
      9g+:em3b\Vixp:PK

2.  Stylistically, I think the line is too long. I'd rewrite line 221
    as:

    gpg2 -d $GPG_OPTS "$passfile" | { read -r pass
    [[ -n $pass ]] || exit 1
    clip "$pass" "$path"
    [[ $tail -eq 1 ]] && cat ; }

    This is far easier to read as a diff, as it's clear to see that the
    middle 2 lines above haven't changed.

Other than that, I like your patch.


-- 
Regards,
Matthew Cengia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: Digital signature
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140214/4660e394/attachment.asc>


More information about the Password-Store mailing list