Skip to content

Fix zsh completion for commands with spaces#533

Closed
lin-hongkuan wants to merge 1 commit into
python-poetry:mainfrom
lin-hongkuan:codex/zsh-completion-spaced-commands
Closed

Fix zsh completion for commands with spaces#533
lin-hongkuan wants to merge 1 commit into
python-poetry:mainfrom
lin-hongkuan:codex/zsh-completion-spaced-commands

Conversation

@lin-hongkuan

@lin-hongkuan lin-hongkuan commented Jun 25, 2026

Copy link
Copy Markdown

Fixes #153.
Fixes #360.

Summary

  • keep zsh completion command values unquoted for commands with spaces, so accepting a completion does not insert literal quote characters
  • add a generated command-name list for zsh completion and match the longest command prefix before falling back to the previous first-word lookup
  • update the zsh completion fixture and add a regression assertion for spaced command completions

Tests

  • PYTHONPATH=src python -m pytest tests/commands/completion/test_completions_command.py -q
  • python -m ruff check src/cleo/commands/completions_command.py src/cleo/commands/completions/templates.py tests/commands/completion/test_completions_command.py
  • python -m ruff format --check src/cleo/commands/completions_command.py src/cleo/commands/completions/templates.py tests/commands/completion/test_completions_command.py
  • python -m towncrier check --compare-with origin/main

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 25, 2026
@Secrus Secrus closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

2 participants