Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ZFS Compression Autocomplete Does Not Suggest ZSTD compression
- X-seq: zsh-workers 54276
- From: Oliver Kiddle <opk@xxxxxxx>
- To: hguenfaf@xxxxxxxxx
- Cc: "zsh-workers@xxxxxxx" <zsh-workers@xxxxxxx>
- Subject: Re: ZFS Compression Autocomplete Does Not Suggest ZSTD compression
- Date: Thu, 02 Apr 2026 17:02:20 +0200
- Archived-at: <https://zsh.org/workers/54276>
- In-reply-to: <ReLpw8UieMahf8bSu6Sk485FFbVfu72Lo1CZAvtzcnFu3qwgR88JJ20eR7G4WxpFlGvTKFx3fNFuZgbnwGgWXO0Rb0xXyJdSE4X2P2HQpJo=@proton.me>
- List-id: <zsh-workers.zsh.org>
- References: <ReLpw8UieMahf8bSu6Sk485FFbVfu72Lo1CZAvtzcnFu3qwgR88JJ20eR7G4WxpFlGvTKFx3fNFuZgbnwGgWXO0Rb0xXyJdSE4X2P2HQpJo=@proton.me>
hguenfaf@xxxxxxxxx wrote:
> So sorry if this is the wrong mailing list to report this, this is my first,
Reporting here is perfect.
> The issue is that zfs set compression=[ALGO] [POOL] command does not show a
> completion for zstd compression algorithm. Please find below the suggested
> algorithms
This is a bug in the completion definition and the patch below fixes it.
There's a $comp_algorithms array which is first set to the basic set and
then extended depending on things like whether you're running openzfs
or Solaris zfs. But it is used before getting extended. In this case,
preventing the early expansion by using single quotes works fine because
it does get expanded later in the _values helper.
> I'm using OpenZFS under Archlinux, with the latest ZSH as of now "zsh 5.9
There have also been other updates to the zfs completion since zsh 5.9
covering OpenZFS 2.2 features. I'll try to update it up to 2.4 soon.
Individual completions taken from our git repository will usually work
fine against the latest release if there are particular commands you
care about.
The patch also fixes one other small error related to quoting in
_values.
Oliver
diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs
index ec904a41b..9012bb6b2 100644
--- a/Completion/Unix/Command/_zfs
+++ b/Completion/Unix/Command/_zfs
@@ -65,10 +65,10 @@ rw_ds_props=(
'aclinherit:value:(discard noallow restricted passthrough passthrough-x)'
'atime:value:(on off)'
'canmount:value:(on off noauto)'
- "checksum:value:($sum_algorithms)"
- "compression:value:($comp_algorithms)"
+ 'checksum:value:($sum_algorithms)'
+ 'compression:value:($comp_algorithms)'
'copies:value:(1 2 3)'
- "dedup:value:($dedup_algorithms)"
+ 'dedup:value:($dedup_algorithms)'
'devices:value:(on off)'
'encryption:value:(off on aes128-ccm aes-192-ccm aes-256-ccm aes-128-gcm aes-192-gcm aes-256-gcm)'
'exec:value:(on off)'
@@ -1416,7 +1416,7 @@ while (( $#state )); do
case $MATCH in
*feature@) _wanted states expl state compadd active enabled disabled ;;
*quota@) _alternative \
- 'sizes: :_numbers -M "m\:{a-zA-Z}={A-Za-z}" -u bytes size \:B {k,M,G,T,P,E,Z}{,B}' \
+ 'sizes: :_numbers -M "m:{a-zA-Z}={A-Za-z}" -u bytes size :B {k,M,G,T,P,E,Z}{,B}' \
'properties:property:(none)'
;;
esac
Messages sorted by:
Reverse Date,
Date,
Thread,
Author