[GH-ISSUE #414] zsh completion does not allow directories to be tab-completed #180

Closed
opened 2026-06-08 11:26:01 +03:00 by zhus · 5 comments
Owner

Originally created by @IzhakJakov on GitHub (Jul 15, 2024).
Original GitHub issue: https://github.com/bootandy/dust/issues/414

I am experiencing the same issue as described in #359:

With the ZSH completion, when I attempt to tab-complete a directory:

$ dust Docu<tab>

it does nothing. The expected behavior is for it to tab-complete the directory name.

The original issue was resolved in #390 so I am not sure if it is me that is doing something wrong but I do not have any other zsh completion ATM.

Moreover, the completion of --<option> works as expected so it is only the paths that are not getting completed.

I am using Macbook with M3 Pro but tested this on a Macbook with Intel i9 and it has the problem.

Originally created by @IzhakJakov on GitHub (Jul 15, 2024). Original GitHub issue: https://github.com/bootandy/dust/issues/414 ### I am experiencing the same issue as described in #359: > With the ZSH completion, when I attempt to tab-complete a directory: > ```sh > $ dust Docu<tab> > ``` > it does nothing. The expected behavior is for it to tab-complete the directory name. The original issue was resolved in #390 so I am not sure if it is me that is doing something wrong but I do not have any other zsh completion ATM. Moreover, the completion of `--<option>` works as expected so it is only the paths that are not getting completed. I am using Macbook with `M3 Pro` but tested this on a Macbook with `Intel i9` and it has the problem.
zhus closed this issue 2026-06-08 11:26:01 +03:00
Author
Owner

@IzhakJakov commented on GitHub (Jul 15, 2024):

$ dust --version
Dust 1.0.0
<!-- gh-comment-id:2228496312 --> @IzhakJakov commented on GitHub (Jul 15, 2024): ```sh $ dust --version Dust 1.0.0 ```
Author
Owner

@IzhakJakov commented on GitHub (Jul 15, 2024):

After a quick investigation it seems like the fix is not in any official release yet thus missing from most pkg managers. I fixed the problem locally now and do not mind creating a PR to patch v1.0.0 if you do not mind creating a branch for v1.0 then after merging the patch you can release as 1.0.1:

$ git checkout tags/v1.0.0 -b v1.0

$ git push --set-upstream origin v1.0
<!-- gh-comment-id:2228560741 --> @IzhakJakov commented on GitHub (Jul 15, 2024): After a quick investigation it seems like the fix is not in any official release yet thus missing from most pkg managers. I fixed the problem locally now and do not mind creating a PR to patch `v1.0.0` if you do not mind creating a branch for `v1.0` then after merging the patch you can release as `1.0.1`: ``` $ git checkout tags/v1.0.0 -b v1.0 $ git push --set-upstream origin v1.0 ```
Author
Owner

@bootandy commented on GitHub (Jul 17, 2024):

Sadly a re-occurring problem. Whenever anyone rebuilds the completions file it seems to destroy the fix for zsh completion.

Does your fix look like this ?
https://github.com/bootandy/dust/commit/0038cb24b4adbb85321e3c36fb7079fc898de44e

<!-- gh-comment-id:2231887029 --> @bootandy commented on GitHub (Jul 17, 2024): Sadly a re-occurring problem. Whenever anyone rebuilds the completions file it seems to destroy the fix for zsh completion. Does your fix look like this ? https://github.com/bootandy/dust/commit/0038cb24b4adbb85321e3c36fb7079fc898de44e
Author
Owner

@IzhakJakov commented on GitHub (Jul 17, 2024):

$ git diff completions/_dust
index ecf5150..8745356 100644
--- completions/_dust
+++ completions/_dust
@@ -19,10 +19,10 @@ _dust() {
 '--depth=[Depth to show]: : ' \
 '-n+[Number of lines of output to show. (Default is terminal_height - 10)]: : ' \
 '--number-of-lines=[Number of lines of output to show. (Default is terminal_height - 10)]: : ' \
-'*-X+[Exclude any file or directory with this name]: : ' \
-'*--ignore-directory=[Exclude any file or directory with this name]: : ' \
-'-I+[Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter]: : ' \
-'--ignore-all-in-file=[Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter]: : ' \
+'*-X+[Exclude any file or directory with this name]:ignore directory:_files' \
+'*--ignore-directory=[Exclude any file or directory with this name]:ignore directory:_files' \
+'-I+[Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter]:ignore all in file:_files' \
+'--ignore-all-in-file=[Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter]:ignore all in file:_files' \
 '-z+[Minimum size file to include in output]: : ' \
 '--min-size=[Minimum size file to include in output]: : ' \
 '(-e --filter -t --file_types)*-v+[Exclude filepaths matching this regex. To ignore png files type\: -v "\\.png\$" ]: : ' \
@@ -72,7 +72,7 @@ _dust() {
 '--help[Print help]' \
 '-V[Print version]' \
 '--version[Print version]' \
-'*::params:' \
+'*: :_files' \
 && ret=0
 }

Basically stole some stuff from #390 and applied them to v1.0

I did it for myself as a tmp solution until your next release but then decided to share so you can have a quick patch for v1.0

Anyways, I noticed you released v1.1.0 a few hours ago so maybe none of this matters anymore. I wait for it update in my system and if there are problems I'll re-open this issue.

Thanks for taking a look!

<!-- gh-comment-id:2232235139 --> @IzhakJakov commented on GitHub (Jul 17, 2024): ```sh $ git diff completions/_dust ``` ```diff index ecf5150..8745356 100644 --- completions/_dust +++ completions/_dust @@ -19,10 +19,10 @@ _dust() { '--depth=[Depth to show]: : ' \ '-n+[Number of lines of output to show. (Default is terminal_height - 10)]: : ' \ '--number-of-lines=[Number of lines of output to show. (Default is terminal_height - 10)]: : ' \ -'*-X+[Exclude any file or directory with this name]: : ' \ -'*--ignore-directory=[Exclude any file or directory with this name]: : ' \ -'-I+[Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter]: : ' \ -'--ignore-all-in-file=[Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter]: : ' \ +'*-X+[Exclude any file or directory with this name]:ignore directory:_files' \ +'*--ignore-directory=[Exclude any file or directory with this name]:ignore directory:_files' \ +'-I+[Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter]:ignore all in file:_files' \ +'--ignore-all-in-file=[Exclude any file or directory with a regex matching that listed in this file, the file entries will be added to the ignore regexs provided by --invert_filter]:ignore all in file:_files' \ '-z+[Minimum size file to include in output]: : ' \ '--min-size=[Minimum size file to include in output]: : ' \ '(-e --filter -t --file_types)*-v+[Exclude filepaths matching this regex. To ignore png files type\: -v "\\.png\$" ]: : ' \ @@ -72,7 +72,7 @@ _dust() { '--help[Print help]' \ '-V[Print version]' \ '--version[Print version]' \ -'*::params:' \ +'*: :_files' \ && ret=0 } ``` --- Basically stole some stuff from #390 and applied them to `v1.0` I did it for myself as a tmp solution until your next release but then decided to share so you can have a quick patch for `v1.0` Anyways, I noticed you released `v1.1.0` a few hours ago so maybe none of this matters anymore. I wait for it update in my system and if there are problems I'll re-open this issue. Thanks for taking a look!
Author
Owner

@IzhakJakov commented on GitHub (Jul 18, 2024):

Seems to be working as expected. Tested with v1.1.1. Thank you! 😊

<!-- gh-comment-id:2235190101 --> @IzhakJakov commented on GitHub (Jul 18, 2024): Seems to be working as expected. Tested with `v1.1.1`. Thank you! 😊
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#180