<feed xmlns='http://www.w3.org/2005/Atom'>
<title>password-store/src/completion/pass.zsh-completion, branch master</title>
<subtitle>Fork of https://git.zx2c4.com/password-store/about/ with support for pass-otp in the dmenu script
</subtitle>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/'/>
<entry>
<title>Escape colons in zsh completion to show url ports</title>
<updated>2021-06-11T16:33:29+00:00</updated>
<author>
<name>Guido Cella</name>
<email>guidocella91@gmail.com</email>
</author>
<published>2020-07-14T04:35:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=ff5ac38f7984d7b3d2912dba106baa2fed52e530'/>
<id>ff5ac38f7984d7b3d2912dba106baa2fed52e530</id>
<content type='text'>
zsh completion cuts filenames after colons, for example port numbers.
This is fixed by escaping colons.
This will also escape backslashes after the first.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
zsh completion cuts filenames after colons, for example port numbers.
This is fixed by escaping colons.
This will also escape backslashes after the first.
</pre>
</div>
</content>
</entry>
<entry>
<title>zsh-completion: add prefix zstyle</title>
<updated>2016-02-06T21:20:57+00:00</updated>
<author>
<name>Benjamin Richter</name>
<email>br@waldteufel.eu</email>
</author>
<published>2016-02-06T20:50:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=675a002e3f9f84e07418b15105af3ab8049eb443'/>
<id>675a002e3f9f84e07418b15105af3ab8049eb443</id>
<content type='text'>
This option can be used to select a different pass repository for
completion. A configuration example is given inside the completion file.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This option can be used to select a different pass repository for
completion. A configuration example is given inside the completion file.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix zsh completion when path contains \</title>
<updated>2016-02-06T19:44:35+00:00</updated>
<author>
<name>Simon Gomizelj</name>
<email>simongmzlj@gmail.com</email>
</author>
<published>2015-12-03T00:29:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=96cab3d8e8ff7f236b23c3429fea80a0d25b7837'/>
<id>96cab3d8e8ff7f236b23c3429fea80a0d25b7837</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix pass zsh completion and autoloading</title>
<updated>2014-07-29T17:19:36+00:00</updated>
<author>
<name>Marc Cornellà</name>
<email>marc.cornella@live.com</email>
</author>
<published>2014-07-28T06:04:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=5a6df91e49376c701381b99d89d61af698c98463'/>
<id>5a6df91e49376c701381b99d89d61af698c98463</id>
<content type='text'>
When autocompleting from `pass &lt;TAB&gt;', sometimes the following errors
appear:

  _values:compvalues:10: not enough arguments
  find: `/home/user/.password-store': No such file or directory
  _values:compvalues:10: not enough arguments
  find: `/home/user/.password-store': No such file or directory

The `_values' error happens when there is no password-store folder *or*
there are no passwords in pass; the `find' error only when there is no
password-store folder.

We can trace it back to line 108, which contains the only `_values'
statement that is executed when we autocomplete from pass. We confirm
this by following the trail of execution, which is

  _pass -&gt; _pass_cmd_show -&gt; _pass_complete_entries -&gt;
        -&gt; _pass_complete_entries_helper

If we try running the command inside `$()' on line 104, we see that it
returns nothing and the output is blank. This means that `_values' only
receives 1 of its 2 mandatory parameters, therefore the above error is
triggered (not enough arguments).

That is unless we don't have a password-store folder, in which case the
`find: [...] no such file or directory' error is *also* triggered.

We solve the first error by supplying a default value of "" if the
command outputs nothing, using the zsh construct ${var:-else}.

We solve the second error by redirecting the find command's stderr output
to /dev/null, so the error is effectively suppressed.

* * * *

This patch also fixes the first tab completion, which currently only
loads the completion function definition.

We do this by adding a `_pass' statement at the end of the file, which
runs the `_pass' completion function after loading its definition.
This is the standard way an autoloaded function works; for other examples
look at zsh's official completion files.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When autocompleting from `pass &lt;TAB&gt;', sometimes the following errors
appear:

  _values:compvalues:10: not enough arguments
  find: `/home/user/.password-store': No such file or directory
  _values:compvalues:10: not enough arguments
  find: `/home/user/.password-store': No such file or directory

The `_values' error happens when there is no password-store folder *or*
there are no passwords in pass; the `find' error only when there is no
password-store folder.

We can trace it back to line 108, which contains the only `_values'
statement that is executed when we autocomplete from pass. We confirm
this by following the trail of execution, which is

  _pass -&gt; _pass_cmd_show -&gt; _pass_complete_entries -&gt;
        -&gt; _pass_complete_entries_helper

If we try running the command inside `$()' on line 104, we see that it
returns nothing and the output is blank. This means that `_values' only
receives 1 of its 2 mandatory parameters, therefore the above error is
triggered (not enough arguments).

That is unless we don't have a password-store folder, in which case the
`find: [...] no such file or directory' error is *also* triggered.

We solve the first error by supplying a default value of "" if the
command outputs nothing, using the zsh construct ${var:-else}.

We solve the second error by redirecting the find command's stderr output
to /dev/null, so the error is effectively suppressed.

* * * *

This patch also fixes the first tab completion, which currently only
loads the completion function definition.

We do this by adding a `_pass' statement at the end of the file, which
runs the `_pass' completion function after loading its definition.
This is the standard way an autoloaded function works; for other examples
look at zsh's official completion files.
</pre>
</div>
</content>
</entry>
<entry>
<title>completion: add new generate flags</title>
<updated>2014-05-08T02:57:16+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2014-05-08T02:57:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=ba160d43eb84be181258c26aa66bcaf05964c909'/>
<id>ba160d43eb84be181258c26aa66bcaf05964c909</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>zsh: posix compatible sed fix for zsh-completion</title>
<updated>2014-05-08T01:20:50+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2014-05-08T01:20:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=a9d84341e13419dd300744d96f3327b67cc56928'/>
<id>a9d84341e13419dd300744d96f3327b67cc56928</id>
<content type='text'>
This reverts commit 56381287a16792b4c6410f07db68e02f3574c213, and
further fixes things.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 56381287a16792b4c6410f07db68e02f3574c213, and
further fixes things.
</pre>
</div>
</content>
</entry>
<entry>
<title>zsh-completion: regression when using BSD sed</title>
<updated>2014-05-06T14:08:05+00:00</updated>
<author>
<name>Kyle Marek-Spartz</name>
<email>kyle.marek.spartz@gmail.com</email>
</author>
<published>2014-05-05T20:16:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=56381287a16792b4c6410f07db68e02f3574c213'/>
<id>56381287a16792b4c6410f07db68e02f3574c213</id>
<content type='text'>
Made sed expression GNU and BSD compatible.

A recent change in pass.zsh-completion broke autocompletion when using
BSD sed. I’ve made the relevant sed expression compatible with GNU and
BSD sed.

Previous change with regression:
http://lists.zx2c4.com/pipermail/password-store/2014-April/000773.html

http://git.zx2c4.com/password-store/commit/src/completion/pass.zsh-completion?id=f82e9d6cf3bc3a12bdfce89bf319d76f79e66efc
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Made sed expression GNU and BSD compatible.

A recent change in pass.zsh-completion broke autocompletion when using
BSD sed. I’ve made the relevant sed expression compatible with GNU and
BSD sed.

Previous change with regression:
http://lists.zx2c4.com/pipermail/password-store/2014-April/000773.html

http://git.zx2c4.com/password-store/commit/src/completion/pass.zsh-completion?id=f82e9d6cf3bc3a12bdfce89bf319d76f79e66efc
</pre>
</div>
</content>
</entry>
<entry>
<title>zsh-completion: only remove next char if /</title>
<updated>2014-04-22T16:39:47+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2014-04-22T16:39:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=f82e9d6cf3bc3a12bdfce89bf319d76f79e66efc'/>
<id>f82e9d6cf3bc3a12bdfce89bf319d76f79e66efc</id>
<content type='text'>
From Kevin:

I found a small bug in the zsh completions.  Basically when the
PASSWORD_STORE_DIR ends in a slash the first character of the
result is eaten, making completion essentially useless. (It does
this before determining matches).

This can be fixed by changing what is line 106 in my version from:

_values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name
.gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##'
| sort)

to

_values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name
.gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}/\\?##" -e
's#\.gpg##' | sort)

The difference is the first sed regex expression.  The original
version assumed that the next character was a slash and removed
it while the new version only removes it if it is a slash.

"s#${prefix}.##" -&gt; "s#${prefix}/\\?##"

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Reported-by: Kevin Cox &lt;kevincox@kevincox.ca&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
From Kevin:

I found a small bug in the zsh completions.  Basically when the
PASSWORD_STORE_DIR ends in a slash the first character of the
result is eaten, making completion essentially useless. (It does
this before determining matches).

This can be fixed by changing what is line 106 in my version from:

_values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name
.gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}.##" -e 's#\.gpg##'
| sort)

to

_values -C 'passwords' $(find -L "$prefix" \( -name .git -o -name
.gpg-id \) -prune -o $@ -print | sed -e "s#${prefix}/\\?##" -e
's#\.gpg##' | sort)

The difference is the first sed regex expression.  The original
version assumed that the next character was a slash and removed
it while the new version only removes it if it is a slash.

"s#${prefix}.##" -&gt; "s#${prefix}/\\?##"

Signed-off-by: Jason A. Donenfeld &lt;Jason@zx2c4.com&gt;
Reported-by: Kevin Cox &lt;kevincox@kevincox.ca&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>reencrypt: remove option, do automatically</title>
<updated>2014-04-17T23:57:13+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2014-04-17T23:57:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=84815317659d40319703bac18cd4388990ed4cee'/>
<id>84815317659d40319703bac18cd4388990ed4cee</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>reencryption: add to completion files</title>
<updated>2014-04-17T23:40:19+00:00</updated>
<author>
<name>Jason A. Donenfeld</name>
<email>Jason@zx2c4.com</email>
</author>
<published>2014-04-17T23:40:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.m-chrzan.xyz/password-store/commit/?id=002882684ba3fb5b4d191794888d139f6b89f64d'/>
<id>002882684ba3fb5b4d191794888d139f6b89f64d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
