File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed
Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,27 @@ function __task_list() {
4141 (( enabled )) || return 0
4242
4343 scripts=()
44+
45+ # Read zstyle verbose option (default = true via -T)
46+ local show_desc
47+ zstyle -T ":completion:${curcontext}:" verbose && show_desc=true || show_desc=false
48+
4449 for item in "${(@)${(f)output}[2,-1]#\* }"; do
4550 task="${item%%:[[:space:]]*}"
46- desc="${item##[^[:space:]]##[[:space:]]##}"
47- scripts+=( "${task//:/\\:}:$desc" )
51+
52+ if [[ "$show_desc" == "true" ]]; then
53+ local desc="${item##[^[:space:]]##[[:space:]]##}"
54+ scripts+=( "${task//:/\\:}:$desc" )
55+ else
56+ scripts+=( "$task" )
57+ fi
4858 done
49- _describe 'Task to run' scripts
59+
60+ if [[ "$show_desc" == "true" ]]; then
61+ _describe 'Task to run' scripts
62+ else
63+ compadd -Q -a scripts
64+ fi
5065}
5166
5267_task() {
Original file line number Diff line number Diff line change @@ -384,3 +384,13 @@ task --completion fish > ~/.config/fish/completions/task.fish
384384```
385385
386386:::
387+
388+ ### Zsh customization
389+
390+ The Zsh completion supports the standard ` verbose ` zstyle to control whether task
391+ descriptions are shown. By default, descriptions are displayed. To show only task
392+ names without descriptions, add this to your ` ~/.zshrc ` (after the completion is loaded):
393+
394+ ``` shell
395+ zstyle ' :completion:*:*:task:*' verbose false
396+ ```
You can’t perform that action at this time.
0 commit comments