Skip to content

Support Bash 3 completion - #1831

Open
pri5h wants to merge 1 commit into
simonw:mainfrom
pri5h:fix-1260-bash-nosort-compatibility
Open

pri5h wants to merge 1 commit into
simonw:mainfrom
pri5h:fix-1260-bash-nosort-compatibility

Conversation

@pri5h

@pri5h pri5h commented Oct 28, 2026

Copy link
Copy Markdown

Summary

  • Make Bash completion compatible with Bash 3.2 by avoiding the unsupported complete -o nosort option on older Bash versions.
  • Retain -o nosort for Bash 4 and newer.
  • Add a regression test for the generated Bash completion script.

Testing

  • uv run pytest — 1275 passed, 1 skipped, 6 xfailed, 26 xpassed.
  • uv run ruff check llm/cli.py tests/test_cli_options.py — passed.
  • git diff --check — passed.

The generated completion script was checked locally; execution on macOS Bash 3.2 has not been verified directly.

@Muguett-DBY Muguett-DBY left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the Bash 3 fallback. One version boundary to consider: Bash 4.0–4.3 also lack complete -o nosort; GNU's Bash 4.4 release notes list that option as new in 4.4. The >= 4 check still selects nosort on those versions. That limitation already exists on main; it isn't introduced by this PR. Could the condition check for 4.4 or newer instead?

There's also a misleading warning on the new Bash 3 path: with Click 8.5, super().source() calls Click's version check, which writes “Shell completion is not supported for Bash versions older than 4.4” even when this fallback would work.

I exercised the exact PR completion class with Click 8.5 and Bash 5.3. The older versions were simulated against the documented option boundary; I didn't run actual Bash 3 or 4. OpenAI Codex (GPT-6) assisted with the review and checks.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants