AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.09k stars 355 forks source link

Use space to select option #167

Closed johnksv closed 5 years ago

johnksv commented 5 years ago

The default behaviour for a select is that space will append " " to the filter. This PR adds support to use space to select an option instead of appending to the filter.

Why? in my use case it doesn't make sense to filter on/with space. Since space is used to select/deselect in multiselect I also think it makes sense that it can be used select an option from an select.

This PR is not related to any issues, so please feel free to do what you would like with the PR.

AlecAivazis commented 5 years ago

Ugh... i was hoping i could leave a comment on a specific line at the same time as posting that. Here's the rest of my response:

I'm not sure it makes sense to have CanUseSpaceToSelect be configurable. In general, I dont think it's a great idea to load up Prompts with configuration since the developer is changing the experience for the end user, not just themselves. It's hard to know if that's what they really want. The Ideal Prompt would "Just Work" and have a consistent interface with other similar libraries so that they are not confused when they run into your survey.

johnksv commented 5 years ago

Closing this one. See you points. Feel free to use the code if you change your mind in the future. :)