Skip to content

feat: add show_hint option to Confirm prompt#345

Merged
djc merged 3 commits into
console-rs:mainfrom
opmr0:feat/confirm-show-hint
Apr 8, 2026
Merged

feat: add show_hint option to Confirm prompt#345
djc merged 3 commits into
console-rs:mainfrom
opmr0:feat/confirm-show-hint

Conversation

@opmr0
Copy link
Copy Markdown
Contributor

@opmr0 opmr0 commented Apr 5, 2026

Adds a show_hint builder method to Confirm that allows hiding the [y/n] hint and prompt suffix. This is useful for simple "press enter to continue" use cases where the hint is noise.

Usage:

Confirm::new()
    .with_prompt("Press enter to continue")
    .show_hint(false)
    .default(true)
    .interact()
    .unwrap();

Changes:

Added show_hint builder method to Confirm that allows hiding the [y/n] hint. Implemented via a new format_confirm_prompt_no_hint trait method with a default implementation


Resolves #344

Comment thread examples/no_hint.rs Outdated
Comment thread src/theme/colorful.rs Outdated
Comment thread src/theme/mod.rs Outdated
Comment thread src/theme/render.rs Outdated
@opmr0 opmr0 requested a review from djc April 6, 2026 12:42
Copy link
Copy Markdown
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

I've resolved the pre-existing CI issues, please rebase and squash your changes into a single commit.

Comment thread src/prompts/confirm.rs Outdated
@opmr0 opmr0 force-pushed the feat/confirm-show-hint branch from b1ee13d to 4bab679 Compare April 7, 2026 11:00
@djc djc merged commit 7b7b797 into console-rs:main Apr 8, 2026
9 checks passed
@djc
Copy link
Copy Markdown
Member

djc commented Apr 8, 2026

Thanks!

@opmr0
Copy link
Copy Markdown
Contributor Author

opmr0 commented Apr 8, 2026

Glad to contribute with you 🤍

@opmr0 opmr0 deleted the feat/confirm-show-hint branch April 8, 2026 09:50
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.

Allow customizing/removing [Y/n] hint and :

2 participants