-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZSH completion does not allow to specify multiple files to trash #338
Comments
PatchThe following patch, when applied to the generated completions, fixes the issue. 23c23
< "(*)::files:_trash_files"
---
> "*:: :->file"
28c28
< local context state line curcontext="$curcontext" one_or_more='(-)*' remainder='(*)'
---
> local context state line curcontext="$curcontext"
30,33c30
< if ((${_shtab_trash_put_options[(I)${(q)one_or_more}*]} + ${_shtab_trash_put_options[(I)${(q)remainder}*]} == 0)); then # noqa: E501
< _shtab_trash_put_options+=(': :_shtab_trash_put_commands' '*::: :->trash-put')
< fi
< _arguments -C -s $_shtab_trash_put_options
---
> _arguments -C -s -S -A -* $_shtab_trash_put_options
42a40,45
> ;;
> file)
> (( CURRENT > 0 )) && line[CURRENT]=()
> line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
> _files -F line && ret=0
> ;; Of course, this is a hacky fix and it should not be upstreamed. I believe that either there is something wrong in the way BehaviorWhen using
When using just This behavior is completely identical to |
@DMaroo just wondering why this shouldn't be upstreamed? Just curious as to whether users should patch this downstream. |
any update on this ? |
Ideally, |
Thanks @DMaroo . I had a look in my system, and I can't find the file to patch. Could you please explain what we should be patching? |
@protist it's one of the directories where ZSH stores completions. You may have to look it up for the OS you're running. I run Arch, and the completions for I had to update the patch for it to work on my system. Here's my gist in case it also helps you. |
Thanks @dnswrsrx. That works great on my system (also Arch). I'm considering opening a task on the Arch tracker to patch it there, since there hasn't been much movement here. |
Describe the bug
Commands provided by this utility allow to specify multiple files to manipulate, but ZSH autocompletions suggest filenames only for one parameter.
trash-cli version
0.23.11.10
Are you using the latest version of trash-cli?
Yes
Have you tried if the bug is present in the latest version of trash-cli?
Yes
Operating system:
Arch Linux
To Reproduce
Expected behavior
The completions should have completed the command the "foo" filename.
The text was updated successfully, but these errors were encountered: