Add '1' and '0' as allowed keys for Confirm#279
Open
Gordon01 wants to merge 1 commit intoconsole-rs:mainfrom
Open
Add '1' and '0' as allowed keys for Confirm#279Gordon01 wants to merge 1 commit intoconsole-rs:mainfrom
Confirm#279Gordon01 wants to merge 1 commit intoconsole-rs:mainfrom
Conversation
pksunkara
reviewed
Sep 11, 2023
| f, | ||
| "{} {} {}", | ||
| self.hint_style.apply_to("(y/n)"), | ||
| self.hint_style.apply_to("(y/n or 1/0)"), |
Collaborator
There was a problem hiding this comment.
Can we not have the hints in prompts and leave them as y/n?
Contributor
Author
There was a problem hiding this comment.
If you don't want to change the hint, I can make a logic to change it to 1/0 when the non-ascii character is read.
Otherwise, users will probably find it hard to discover alternative keys.
Collaborator
There was a problem hiding this comment.
The issue with showing things after a key is pressed is that in some scenarios, the prompt is considered answered as soon as a key is pressed. So, I am wondering if it's worth showing it at all.
Maybe for those scenarios where it waits, we can change it to show 1/0 only if one of them is pressed?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes: #256
In an effort to foster a more inclusive and accessible user interface, this PR introduces '1' and '0' as alternative input options alongside 'y' and 'n' in the text confirmation prompt.