The sound distributed version control system

#860 Zsh completion for 'pijul add', 'record', 'unrecord', ... isn't listing files/changes

Opened by dblsaiko on January 3, 2024
dblsaiko on January 3, 2024

Pressing tab after ‘pijul add’ or ‘pijul record’ or ‘pijul unrecord’ in zsh only gives the following output, but doesn’t list files (or changes in case of unrecord) nor lets you complete if you start typing the name of something. This is only a few examples but probably the most prominent.

% pijul add
completing paths -- Paths to add to the internal tree
% pijul unrecord
completing change-id -- The hash of a change (unambiguous prefixes are accepted)

Using pijul 1.0.0-beta.7 from nixpkgs.

dblsaiko on January 4, 2024

Ah, I see you’re using some generated completions. It doesn’t look extensible at all, so you’ll probably need handwritten completions for Pijul concepts like changes, remotes, channels, etc., but at least I’ve added some stuff like file paths via the value hints. I have no idea how to test it though (eval "$(pijul completion zsh)" didn’t work) so it may or may not work.

dblsaiko added a change on January 4, 2024
pmeunier on February 8, 2024

It doesn’t work with zsh indeed. I know approximately nothing about completions (I didn’t write that subcommand in Pijul), any idea how to proceed?

dblsaiko on February 8, 2024

The change should make it better, but only for completing files and other things that clap has support for. Anything else like completing change IDs will need handwritten zsh completions, I think.