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

Cherry-pick: Change selection prompt from space to enter. #269

Closed patrickdillon closed 4 years ago

patrickdillon commented 4 years ago

Cherry-pick this to V1. We will be upgrading master branch of our project to Go modules and upgrading to V2 soon, but older releases will be stuck on V1.

When using select or multiselect, the user is prompted to make a selection using space, but entering space causes results to be filtered by space. This commit updates the prompt to tell users to make a selection using the enter key.

AlecAivazis commented 4 years ago

Looks good to me! I'll merge once travis gives us the check. Thanks for doing this 👍

patrickdillon commented 4 years ago

@AlecAivazis Travis is failing with what looks like an unrelated infrastructure issue:

go get: -t flag is a no-op when using modules
gopkg.in/AlecAivazis/survey.v1/examples
gopkg.in/AlecAivazis/survey.v1/tests
# gopkg.in/AlecAivazis/survey.v1/tests
tests\confirm.go:41:6: main redeclared in this block
    previous declaration at tests\ask.go:29:6
tests\doubleSelect.go:9:5: simpleQs redeclared in this block
    previous declaration at tests\ask.go:10:5
tests\doubleSelect.go:28:6: main redeclared in this block
    previous declaration at tests\confirm.go:41:6
tests\editor.go:11:5: answer redeclared in this block
    previous declaration at tests\confirm.go:8:5
tests\editor.go:13:5: goodTable redeclared in this block
    previous declaration at tests\confirm.go:10:5
tests\editor.go:57:6: main redeclared in this block
    previous declaration at tests\doubleSelect.go:28:6
tests\help.go:16:5: goodTable redeclared in this block
    previous declaration at tests\editor.go:13:5
tests\help.go:53:6: main redeclared in this block
    previous declaration at tests\editor.go:57:6
tests\input.go:29:6: main redeclared in this block
    previous declaration at tests\help.go:53:6
tests\longSelect.go:5:6: main redeclared in this block
    previous declaration at tests\input.go:29:6
tests\longSelect.go:5:6: too many errors
# gopkg.in/AlecAivazis/survey.v1/examples
examples\longlist.go:32:6: main redeclared in this block
    previous declaration at examples\countrylist.go:265:6
examples\longmulti.go:265:6: main redeclared in this block
    previous declaration at examples\longlist.go:32:6
examples\map.go:10:5: simpleQs redeclared in this block
    previous declaration at examples\longlist.go:10:5
examples\map.go:28:6: main redeclared in this block
    previous declaration at examples\longmulti.go:265:6
examples\simple.go:10:5: simpleQs redeclared in this block
    previous declaration at examples\map.go:10:5
examples\simple.go:29:6: main redeclared in this block
    previous declaration at examples\map.go:28:6
examples\validation.go:30:6: main redeclared in this block
    previous declaration at examples\simple.go:29:6
The command "go get -v -t ./..." failed and exited with 2 during .
Your build has been stopped.
The command "eval go get -v -t ./... " failed 3 times.

I tried playing around with changing the go version but that was the extent of it. Not much experience with travis or go mods. Can you take a look?

AlecAivazis commented 4 years ago

@patrickdillon no worries! I can take it from here and merge this in. I will make sure the build passes before cutting a new version. Thanks for the contribution! 👍