Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
RFC/PATCH: Fix BSD package completion
- X-seq: zsh-workers 34571
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: RFC/PATCH: Fix BSD package completion
- Date: Thu, 19 Feb 2015 10:50:26 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=3yvyq5rSNW0Y1zXEAiK6ZkxO+eqzz9x1b9vzTtjCL94=; b=qW9jNBbnsCrJw/swcDtbbmTicGQmUmX9JBiEOR+8kfz2JTD703DeInj/dyVVcysqCq 8TWr8HggBYu3sJ5MjXSwHF7ajBUTixuq6Vt2x6z1mD7+OF4WT3Sngb91GkKblNgnEipp Ss7V2WlIk800cJ+HshBzieqjtNTw5zxLF0Q/710rrp/ocKMitqyZKTp5EBUWjisBvFWe QgUzYct/cIVJjNVDE1DSf9QVezPsyHxSEJKgB6jP55cWA67uiU9ed8FrPW6dSEtqk/tV GdyPLeleXIzLNzEMqCr5LSiwpD+8F+rDSBIoxxYMnjFZO6WEISWfcWVx+zFj0s16UW2x hJGw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
with the last line uncommented (or the unmodified original), completing
/us<tab>
deletes the whole input. Presumably _files doesn't interact well with
adding the same strings in full with a raw compadd. I didn't try adding
something to $PKG_PATH so maybe the middle line breaks too. Fun fact,
that path/paths typo has been there since the initial commit in 2000,
and even so, $paths always contained a single empty element anyway.
To reproduce this on a non-bsd system, just set PACKAGES to some directory
that has All/*.tgz in it.
---
Completion/BSD/Command/_bsd_pkg | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Completion/BSD/Command/_bsd_pkg b/Completion/BSD/Command/_bsd_pkg
index 9f4b0f1..200d99f 100644
--- a/Completion/BSD/Command/_bsd_pkg
+++ b/Completion/BSD/Command/_bsd_pkg
@@ -15,10 +15,10 @@ _bsd_pkg_pkgfiles() {
pkgsdir=${PACKAGES:-$portsdir/packages}/All
- paths=( "${(@)${(@s.:.)PKG_PATH}:#}" )
+ paths=( ${(@s.:.)PKG_PATH} )
_files "$@" -g '*.t[bg]z(-.)' && ret=0
- (( $#path )) && _files "$@" -W paths -g '*.t[bg]z(-.)' && ret=0
- compadd "$@" - $pkgsdir/*.t[bg]z(-.) && ret=0
+ (( $#paths )) && _files "$@" -W paths -g '*.t[bg]z(-.)' && ret=0
+ #_wanted pkgs expl 'packages' compadd "$@" - $pkgsdir/*.t[bg]z(-.) && ret=0
return ret
}
--
2.2.0.GIT
Messages sorted by:
Reverse Date,
Date,
Thread,
Author