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

Closed
opened 2026-06-08 11:25:56 +03:00 by zhus · 8 comments
Owner

Originally created by @mdekstrand on GitHub (Dec 28, 2023).
Original GitHub issue: https://github.com/bootandy/dust/issues/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.

Originally created by @mdekstrand on GitHub (Dec 28, 2023). Original GitHub issue: https://github.com/bootandy/dust/issues/359 With the ZSH completion, when I attempt to tab-complete a directory: ```console $ dust Docu<tab> ``` it does nothing. The expected behavior is for it to tab-complete the directory name.
zhus closed this issue 2026-06-08 11:25:56 +03:00
Author
Owner

@bootandy commented on GitHub (Jan 4, 2024):

$ echo $SHELL /usr/bin/zsh

$ dust [TAB]

this works for me.

Can you double check this or see if it works on bash ?

<!-- gh-comment-id:1876005560 --> @bootandy commented on GitHub (Jan 4, 2024): $ echo $SHELL /usr/bin/zsh $ dust [TAB] this works for me. Can you double check this or see if it works on bash ?
Author
Owner

@mdekstrand commented on GitHub (Jan 4, 2024):

Just tried again, no dice.

I'm ZSH on MacOS, using Dust 0.8.6 and its completions installed by Homebrew. I also just tried installing the latest version of Dust (brew install --HEAD dust), and the problem persists.

Bash successfully completes the directory.

<!-- gh-comment-id:1876042593 --> @mdekstrand commented on GitHub (Jan 4, 2024): Just tried again, no dice. I'm ZSH on MacOS, using Dust 0.8.6 and its completions installed by Homebrew. I also just tried installing the latest version of Dust (`brew install --HEAD dust`), and the problem persists. Bash successfully completes the directory.
Author
Owner

@bootandy commented on GitHub (Jan 6, 2024):

code points:
https://github.com/bootandy/dust/tree/master/completions
https://github.com/bootandy/dust/blob/master/build.rs

commit:
https://github.com/bootandy/dust/commit/81d52e6e3a6aa5220eb19c72fbc4f9ad75fda7f2

I'm not sure what I can do here, I don't have a mac so I can't reproduce this - you are welcome to try and fix it yourself

Perhaps try the command: rehash ?

<!-- gh-comment-id:1879622388 --> @bootandy commented on GitHub (Jan 6, 2024): code points: https://github.com/bootandy/dust/tree/master/completions https://github.com/bootandy/dust/blob/master/build.rs commit: https://github.com/bootandy/dust/commit/81d52e6e3a6aa5220eb19c72fbc4f9ad75fda7f2 I'm not sure what I can do here, I don't have a mac so I can't reproduce this - you are welcome to try and fix it yourself Perhaps try the command: rehash ?
Author
Owner

@wickles commented on GitHub (Feb 5, 2024):

I had fixed this before in 0038cb24b4 but it looks like it got reverted in 2fa14ca19c.

<!-- gh-comment-id:1927840235 --> @wickles commented on GitHub (Feb 5, 2024): I had fixed this before in 0038cb24b4adbb85321e3c36fb7079fc898de44e but it looks like it got reverted in 2fa14ca19cd80ba2be106784e2626b64b199e61b.
Author
Owner

@bootandy commented on GitHub (Feb 11, 2024):

thanks for your comment @wickles - I must have something that auto-updates and over-writes it. I'll investigate.

<!-- gh-comment-id:1937856529 --> @bootandy commented on GitHub (Feb 11, 2024): thanks for your comment @wickles - I must have something that auto-updates and over-writes it. I'll investigate.
Author
Owner

@bootandy commented on GitHub (Feb 22, 2024):

Which Z-shell version are you guys running ?

$ $SHELL --version 5.8.1 (x86_64-ubuntu-linux-gnu)

I've no idea what to do here. I can't cause a failure on my system with my zshell.
If I try and edit the completions files running 'cargo build' will reset them back to what they were before.

<!-- gh-comment-id:1957974623 --> @bootandy commented on GitHub (Feb 22, 2024): Which Z-shell version are you guys running ? `$ $SHELL --version 5.8.1 (x86_64-ubuntu-linux-gnu) ` I've no idea what to do here. I can't cause a failure on my system with my zshell. If I try and edit the completions files running 'cargo build' will reset them back to what they were before.
Author
Owner

@BuonOmo commented on GitHub (Mar 11, 2024):

$ brew install --HEAD dust
# reload shell
$ dust --version
Dust 0.9.0
$ $SHELL --version
zsh 5.9 (x86_64-apple-darwin23.0)
$ dust ~/<tab><tab> # fails
$ which _dust
_dust () {
	typeset -A opt_args
	typeset -a _arguments_options
	local ret=1 
	if is-at-least 5.2
	then
		_arguments_options=(-s -S -C) 
	else
		_arguments_options=(-s -C) 
	fi
	local context curcontext="$curcontext" state line 
	_arguments "${_arguments_options[@]}" '-d+[Depth to show]: : ' '--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]: : ' '-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\$" ]: : ' '(-e --filter -t --file_types)*--invert-filter=[Exclude filepaths matching this regex. To ignore png files type\: -v "\\.png\$" ]: : ' '(-t --file_types)*-e+[Only include filepaths matching this regex. For png files type\: -e "\\.png\$" ]: : ' '(-t --file_types)*--filter=[Only include filepaths matching this regex. For png files type\: -e "\\.png\$" ]: : ' '-w+[Specify width of output overriding the auto detection of terminal width]: : ' '--terminal_width=[Specify width of output overriding the auto detection of terminal width]: : ' '-S+[Specify memory to use as stack size - use if you see\: '\''fatal runtime error\: stack overflow'\'' (default low memory=1048576, high memory=1073741824)]: : ' '--stack-size=[Specify memory to use as stack size - use if you see\: '\''fatal runtime error\: stack overflow'\'' (default low memory=1048576, high memory=1073741824)]: : ' '-p[Subdirectories will not have their path shortened]' '--full-paths[Subdirectories will not have their path shortened]' '-L[dereference sym links - Treat sym links as directories and go into them]' '--dereference-links[dereference sym links - Treat sym links as directories and go into them]' '-x[Only count the files and directories on the same filesystem as the supplied directory]' '--limit-filesystem[Only count the files and directories on the same filesystem as the supplied directory]' '-s[Use file length instead of blocks]' '--apparent-size[Use file length instead of blocks]' '-r[Print tree upside down (biggest highest)]' '--reverse[Print tree upside down (biggest highest)]' '-c[No colors will be printed (Useful for commands like\: watch)]' '--no-colors[No colors will be printed (Useful for commands like\: watch)]' '-b[No percent bars or percentages will be displayed]' '--no-percent-bars[No percent bars or percentages will be displayed]' '-B[percent bars moved to right side of screen]' '--bars-on-right[percent bars moved to right side of screen]' '-R[For screen readers. Removes bars. Adds new column\: depth level (May want to use -p too for full path)]' '--screen-reader[For screen readers. Removes bars. Adds new column\: depth level (May want to use -p too for full path)]' '--skip-total[No total row will be displayed]' '-f[Directory '\''size'\'' is number of child files instead of disk size]' '--filecount[Directory '\''size'\'' is number of child files instead of disk size]' '-i[Do not display hidden files]' '--ignore_hidden[Do not display hidden files]' '(-d --depth -D --only-dir)-t[show only these file types]' '(-d --depth -D --only-dir)--file_types[show only these file types]' '-H[print sizes in powers of 1000 (e.g., 1.1G)]' '--si[print sizes in powers of 1000 (e.g., 1.1G)]' '-P[Disable the progress indication.]' '--no-progress[Disable the progress indication.]' '(-F --only-file -t --file_types)-D[Only directories will be displayed.]' '(-F --only-file -t --file_types)--only-dir[Only directories will be displayed.]' '(-D --only-dir)-F[Only files will be displayed. (Finds your largest files)]' '(-D --only-dir)--only-file[Only files will be displayed. (Finds your largest files)]' '-h[Print help]' '--help[Print help]' '-V[Print version]' '--version[Print version]' '*::params:' && ret=0 
}

Hope this helps @bootandy !

<!-- gh-comment-id:1989175938 --> @BuonOmo commented on GitHub (Mar 11, 2024): ```sh $ brew install --HEAD dust # reload shell $ dust --version Dust 0.9.0 $ $SHELL --version zsh 5.9 (x86_64-apple-darwin23.0) $ dust ~/<tab><tab> # fails $ which _dust _dust () { typeset -A opt_args typeset -a _arguments_options local ret=1 if is-at-least 5.2 then _arguments_options=(-s -S -C) else _arguments_options=(-s -C) fi local context curcontext="$curcontext" state line _arguments "${_arguments_options[@]}" '-d+[Depth to show]: : ' '--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]: : ' '-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\$" ]: : ' '(-e --filter -t --file_types)*--invert-filter=[Exclude filepaths matching this regex. To ignore png files type\: -v "\\.png\$" ]: : ' '(-t --file_types)*-e+[Only include filepaths matching this regex. For png files type\: -e "\\.png\$" ]: : ' '(-t --file_types)*--filter=[Only include filepaths matching this regex. For png files type\: -e "\\.png\$" ]: : ' '-w+[Specify width of output overriding the auto detection of terminal width]: : ' '--terminal_width=[Specify width of output overriding the auto detection of terminal width]: : ' '-S+[Specify memory to use as stack size - use if you see\: '\''fatal runtime error\: stack overflow'\'' (default low memory=1048576, high memory=1073741824)]: : ' '--stack-size=[Specify memory to use as stack size - use if you see\: '\''fatal runtime error\: stack overflow'\'' (default low memory=1048576, high memory=1073741824)]: : ' '-p[Subdirectories will not have their path shortened]' '--full-paths[Subdirectories will not have their path shortened]' '-L[dereference sym links - Treat sym links as directories and go into them]' '--dereference-links[dereference sym links - Treat sym links as directories and go into them]' '-x[Only count the files and directories on the same filesystem as the supplied directory]' '--limit-filesystem[Only count the files and directories on the same filesystem as the supplied directory]' '-s[Use file length instead of blocks]' '--apparent-size[Use file length instead of blocks]' '-r[Print tree upside down (biggest highest)]' '--reverse[Print tree upside down (biggest highest)]' '-c[No colors will be printed (Useful for commands like\: watch)]' '--no-colors[No colors will be printed (Useful for commands like\: watch)]' '-b[No percent bars or percentages will be displayed]' '--no-percent-bars[No percent bars or percentages will be displayed]' '-B[percent bars moved to right side of screen]' '--bars-on-right[percent bars moved to right side of screen]' '-R[For screen readers. Removes bars. Adds new column\: depth level (May want to use -p too for full path)]' '--screen-reader[For screen readers. Removes bars. Adds new column\: depth level (May want to use -p too for full path)]' '--skip-total[No total row will be displayed]' '-f[Directory '\''size'\'' is number of child files instead of disk size]' '--filecount[Directory '\''size'\'' is number of child files instead of disk size]' '-i[Do not display hidden files]' '--ignore_hidden[Do not display hidden files]' '(-d --depth -D --only-dir)-t[show only these file types]' '(-d --depth -D --only-dir)--file_types[show only these file types]' '-H[print sizes in powers of 1000 (e.g., 1.1G)]' '--si[print sizes in powers of 1000 (e.g., 1.1G)]' '-P[Disable the progress indication.]' '--no-progress[Disable the progress indication.]' '(-F --only-file -t --file_types)-D[Only directories will be displayed.]' '(-F --only-file -t --file_types)--only-dir[Only directories will be displayed.]' '(-D --only-dir)-F[Only files will be displayed. (Finds your largest files)]' '(-D --only-dir)--only-file[Only files will be displayed. (Finds your largest files)]' '-h[Print help]' '--help[Print help]' '-V[Print version]' '--version[Print version]' '*::params:' && ret=0 } ``` Hope this helps @bootandy !
Author
Owner

@YHYJ commented on GitHub (Mar 28, 2024):

  • System: Arch Linux
  • zsh 5.9 (x86_64-pc-linux-gnu)

Everything works fine in bash, dust <TAB> cannot be completed in zsh

<!-- gh-comment-id:2024280078 --> @YHYJ commented on GitHub (Mar 28, 2024): - System: Arch Linux - zsh 5.9 (x86_64-pc-linux-gnu) Everything works fine in bash, `dust <TAB>` cannot be completed in zsh
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#161