Skip to content

Commit 5d272c9

Browse files
committed
fix: zsh pass empty partial when no positional args exist
When _arguments -C resets $words to only positional args and there are none yet (user pressed TAB after 'sentry issue list '), the empty words array caused 'list' to be misinterpreted as the partial. Now conditionally appends an empty string only when words is empty.
1 parent d95bf36 commit 5d272c9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/lib/completions.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,13 @@ ${caseBranches}
443443
else
444444
completions+=("\${value}")
445445
fi
446-
done < <(${binaryName} __complete "$line[1]" "$line[2]" "\${words[@]}" 2>/dev/null)
446+
done < <(
447+
if (( \${#words} == 0 )); then
448+
${binaryName} __complete "$line[1]" "$line[2]" "" 2>/dev/null
449+
else
450+
${binaryName} __complete "$line[1]" "$line[2]" "\${words[@]}" 2>/dev/null
451+
fi
452+
)
447453
if (( \${#completions} )); then
448454
_describe -t values 'value' completions
449455
fi

0 commit comments

Comments
 (0)