laravel / prompts

Beautiful and user-friendly forms for your command-line PHP applications.
https://laravel.com/docs/prompts
MIT License
533 stars 94 forks source link

Press any key to continue? #104

Closed eleftrik closed 10 months ago

eleftrik commented 10 months ago

I know this sounds a bit silly... But is there a way to ask the user to press any key to continue? I don't need to prompt any choice between two values. After reading a text or a warning, I would like him to press any key to continue.

Thank you!

driesvints commented 10 months ago

Hi there. I don't think we'll be adding this feature ourselves at this time sorry. If you want and can, you can try a PR to see if it'll get accepted. Thanks

eleftrik commented 10 months ago

@driesvints Thanks for the quick feedback.

@jessarcher What do you think about this very small feature? Could it be worth implementing it? (I could try a PR). Thanks

jessarcher commented 10 months ago

Hey @eleftrik,

I've needed that sort of thing in the past so I think it's worthwhile. I've previously used this quick approach:

echo 'Press enter to continue...'.PHP_EOL;
`read -s`;
echo 'You have continued.'.PHP_EOL;

But I think with Prompts we'd want to follow the design of the other prompts with a renderer and key listeners.