Skip to content

Accept any capitalization at init's environment prompt - #23

Merged
jbedient-kizen merged 1 commit into
mainfrom
bug/init-env-prompt-case-insensitive
Sep 1, 2026
Merged

Accept any capitalization at init's environment prompt#23
jbedient-kizen merged 1 commit into
mainfrom
bug/init-env-prompt-case-insensitive

Conversation

@jbedient-kizen

@jbedient-kizen jbedient-kizen commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

kizen init's Environment prompt rejected correctly-typed answers because of their case, and never revealed its own escape hatch.

What was wrong

Rich's choices matching is case-sensitive by default. Typing Go for a go business — the natural way to capitalize it — looped forever on "please select one of the available options" with no indication why. From the user's side that is indistinguishable from the prompt not accepting input at all.

Separately, Rich's stock rejection message never mentioned that url is itself one of the listed choices and opens a second free-text prompt. Anyone whose environment is not one of the curated names had no way to discover that, and could end up re-typing their real host indefinitely.

What changed

  • _ask passes case_sensitive=False, so capitalization no longer matters.
  • A small _EnvironmentPrompt subclass overrides illegal_choice_message to say directly: Type "url" to enter a custom address instead.

Both are confined to cli/init.py. No flags, no --help changes, so scripts/cli-tree-baseline.txt is untouched.

Verification

bin/check.sh builder-cli — lint, format, typecheck, test, extra_checks all pass: 1251 passed, 5 skipped, 76 deselected. (The 5th skip is the chdb importorskip, legitimate without --extra connectors.)

The two new tests were confirmed to genuinely cover the fix rather than pass either way — with init.py reverted to main they both fail:

FAILED tests/test_cli.py::test_init_environment_picker_is_case_insensitive
FAILED tests/test_cli.py::test_init_environment_picker_mistyped_name_shows_url_hint
2 failed, 98 deselected

Rich's `choices` matching is case-sensitive by default, so typing `Go` for a
`go` business — the natural way to capitalize it — looped forever on "please
select one of the available options" with no indication why, indistinguishable
from the prompt simply not accepting input.

Rich's stock rejection message also never mentioned that `url` is itself one of
the listed choices and opens a second free-text prompt, so anyone whose
environment is not one of the curated names had no way to find the escape hatch.
@jbedient-kizen
jbedient-kizen force-pushed the bug/init-env-prompt-case-insensitive branch from 15b8d5d to 408af97 Compare September 1, 2026 18:22
@jbedient-kizen
jbedient-kizen merged commit fa776ef into main Sep 1, 2026
4 checks passed
@jbedient-kizen
jbedient-kizen deleted the bug/init-env-prompt-case-insensitive branch September 4, 2026 16:52
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