AlecAivazis / survey

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

Key "enter" is invalid in help text when using multi-select #280

Closed g1ntas closed 4 years ago

g1ntas commented 4 years ago

In multi-select prompt help text says to use enter key to select option, but that's not the case, space is the actual working key that should be shown in help text, enter, on the other hand, is used to submit answer.

I did a quick investigation, and it seems that the issue was caused by https://github.com/AlecAivazis/survey/pull/260, I don't know what the original problem was that @patrickdillon had, but by looking at the code at https://github.com/AlecAivazis/survey/blob/v2.0.6/multiselect.go#L90 it's certainly programmed to capture space key.

AlecAivazis commented 4 years ago

doh! okay, i was sort of hoping I could trust the original issue. There are a few pending things about this help text so I will fix this now. Thanks for bringing it to my attention

patrickdillon commented 4 years ago

Perhaps this varies by OS

AlecAivazis commented 4 years ago

Well i'm going to revert the change since @g1ntas is correct.

What OS are you working on @patrickdillon?

AlecAivazis commented 4 years ago

@g1ntas - i just released v2.0.7 which should have the updated text. Thanks again!

patrickdillon commented 4 years ago

Fedora, but I'm just conjecturing and that is almost certainly not the problem.

We are using Select not MultiSelect and as I look at it, it is wrapped in AskOne, e.g. https://github.com/openshift/installer/blob/master/pkg/asset/installconfig/ssh.go#L82

I will have to take a closer look. Perhaps we are doing something out of the ordinary.