GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — When prompting, use `show_default` as the default if its a string by thejcannon · Pull Request #2837 · pallets/click

Conversation

@thejcannon

@thejcannon thejcannon commented Jan 6, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This PR just makes sure the default handed to .prompt is the show_default if its a string (to match the help).

fixes #2836

  • Add tests that demonstrate the correct behavior of the change. Tests
    should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in CHANGES.rst summarizing the change and linking to the issue.
  • Add .. versionchanged:: entries in any relevant code docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
thejcannon and others added 2 commits January 6, 2025 16:03
@thejcannon
Use show_default if its a string
a898527
@pre-commit-ci-lite
[pre-commit.ci lite] apply automatic fixes
02192a0
@thejcannon

thejcannon commented Jan 6, 2025

Copy link
Copy Markdown
Contributor Author

oh duh, this changes the default 🤦 . Gotta go deeper...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

thejcannon and others added 7 commits January 6, 2025 16:14
@thejcannon
Update core.py
1fb06a2
@thejcannon
Update termui.py
f6e5792
@pre-commit-ci-lite
[pre-commit.ci lite] apply automatic fixes
b82da09
@thejcannon
Update termui.py
195ebba
@thejcannon
add tests
460a142
@pre-commit-ci-lite
[pre-commit.ci lite] apply automatic fixes
6f2f164
@thejcannon
CHANGES
304f5fa
@thejcannon
thejcannon marked this pull request as ready for review January 7, 2025 02:03
Rowlando13
Rowlando13 reviewed Aug 23, 2025
View reviewed changes
Comment thread src/click/termui.py
if type is not None and show_choices and isinstance(type, Choice):
prompt += f" ({', '.join(map(str, type.choices))})"
if isinstance(show_default, str):
default = f"({show_default})"

@Rowlando13 Rowlando13 Aug 23, 2025

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This should be `default = f"{prompt} ({show_default})". Also add this to the test.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Rowlando13

Rowlando13 commented Aug 23, 2025

Copy link
Copy Markdown
Member

Please rebase on main to resolve the changes.rst. With merge after #3030.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Rowlando13 Rowlando13 added the bug label Aug 23, 2025
@Rowlando13
Rowlando13 marked this pull request as draft August 23, 2025 08:02
@thejcannon thejcannon closed this by deleting the head repository Oct 30, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 14, 2025
@kdeldycke kdeldycke added the prompt Interactive input and confirmation label Mar 25, 2026
@kdeldycke kdeldycke added this to the 8.3.3 milestone Mar 25, 2026
@kdeldycke

kdeldycke commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

A PR is ready to be merged at: #3165

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke

kdeldycke commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

This PR has been superseded by #3328.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@Rowlando13 Rowlando13 Rowlando13 left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

prompt Interactive input and confirmation

Projects

None yet

Milestone

8.3.3

Development

Successfully merging this pull request may close these issues.

show_default as a string isn't used in prompts as the default shown

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@thejcannon @Rowlando13 @kdeldycke
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.