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

feat: interactive confirm with confirmation #648

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

KarolosLykos
Copy link
Contributor

Fixes #644

To address this, I propose introducing a new option WithConfirmation(true) to the pterm.DefaultInteractiveConfirm to enable the behavior of waiting for the user to confirm their answer by pressing the <Enter> key.

I have created a draft pull request that introduces this new option named WithConfirmation. I'm seeking feedback on whether you agree with this approach and if you'd like to proceed with it.

Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.13%. Comparing base (1a9d517) to head (a690822).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #648      +/-   ##
==========================================
+ Coverage   81.05%   81.13%   +0.08%     
==========================================
  Files          33       33              
  Lines        4176     4194      +18     
==========================================
+ Hits         3385     3403      +18     
  Misses        718      718              
  Partials       73       73              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@elfrucool
Copy link

It feels a bit odd that after typing y or n it writes a new line with the legend (Press enter to confirm), it would be better if the (Press enter to confirm) appears the first time and when typing y/n it doesn't go to next line, but, instead replaces the text on same line until press enter

@elfrucool
Copy link

apart of that, I like it

@KarolosLykos KarolosLykos marked this pull request as ready for review March 14, 2024 15:32
@KarolosLykos KarolosLykos changed the title feat: interractive confirm with confirmation feat: interactive confirm with confirmation Mar 16, 2024
@github-actions github-actions bot added feature and removed feature labels Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make interactive confirm optionally accept return key for confirmation
2 participants