Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

[survey/multiline.go] Make the sentence "Enter 2 empty lines to finish" less confusing. #419

Open
vlours opened this issue May 11, 2022 · 3 comments
Labels

Comments

@vlours
Copy link

vlours commented May 11, 2022

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-
@mislav
Copy link
Collaborator

mislav commented May 16, 2022

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

@vlours
Copy link
Author

vlours commented May 17, 2022

what about:

Press Enter twice to end input (or Ctr+C to break)

This will also provide the way to break it.

@mislav
Copy link
Collaborator

mislav commented May 17, 2022

@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

if r == '\r' || r == '\n' || r == KeyEndTransmission {

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants