Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirmation should wait for Enter key to be pressed #66

Closed
abonander opened this issue May 22, 2020 · 4 comments · Fixed by #70
Closed

Confirmation should wait for Enter key to be pressed #66

abonander opened this issue May 22, 2020 · 4 comments · Fixed by #70

Comments

@abonander
Copy link

Currently the confirmation proceeds immediately on a single key being input, which isn't really inline with conventional CLI design. I'd expect it to wait for Enter to be pressed even when giving an explicit answer.

@pksunkara
Copy link
Collaborator

This should be optional behaviour user can opt in to.

@abonander
Copy link
Author

abonander commented May 22, 2020

Every CLI program I've ever used (maybe with one or two exceptions) that's implemented confirmations like this has waited for the Enter key, so I would argue that it should be the default, but if the alternative is not having it at all then I'm fine with it being optional.

@nicklasring
Copy link

Just noticed this, should really wait for the user to press enter so you have one extra second to think over what you're doing or as @pksunkara wrote, an optional behaviour.

@abreis
Copy link
Contributor

abreis commented Jun 18, 2020

I've opened a PR in #70.

I opted to keep the current behavior as the default since apps using Confirm could be part of scripts (e.g., via expect) and this change in behavior would break them, but I agree that this new behavior feels more unix-y and should be made the default in a future release.

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 a pull request may close this issue.

4 participants