survey
survey copied to clipboard
[survey/multiline.go] Make the sentence "Enter 2 empty lines to finish" less confusing.
Hi guys,
Recently I've used a command which is including this Go file.
As a no-English first language speaker, I was a little bit confused, as I’ve first understood the sentence "[Enter 2 empty lines to finish]" as:
Enter 2 empty lines to “cancel”
So I was thinking if it will be better to use a strong word to Confirm
Press Enter two additional times to confirm your choice
# grep -n -A2 -B2 "Enter 2 empty lines to finish" cloud-credential-operator/vendor/github.com/AlecAivazis/survey/v2/multiline.go
33-{{- else }}
34- {{- if .Default}}{{color "white"}}({{.Default}}) {{color "reset"}}{{end}}
35: {{- color "cyan"}}[Enter 2 empty lines to finish]{{color "reset"}}
36-{{- end}}`
37-
I think this will have less confusion here:
33-{{- else }}
34- {{- if .Default}}{{color "white"}}({{.Default}}) {{color "reset"}}{{end}}
35: {{- color "cyan"}}[Press Enter two additional times to confirm your choice]{{color "reset"}}
36-{{- end}}`
37-
Agreed that the text could use an improvement, and thank you for proposing!
What do you think about something like the following:
Press Enter twice to end input
what about:
Press Enter twice to end input (or Ctr+C to break)
This will also provide the way to break it.
@vlours Ctrl-C is implicitly always available to abort the program, including during any Survey prompt. I don't think we have to additionally point it out.
However, Ctrl-D can be used as a signal that the user has finished typing input. I think that in this codebase, that's called KeyEndTransmission https://github.com/AlecAivazis/survey/blob/93657ef69381dd1ffc7a4a9cfe5a2aefff4ca4ad/terminal/runereader.go#L104