You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want the user to paste a JWT token (currently 1,141 characters) via os.Stdin without echoing it on the terminal. ReadPassword seemed like a good candidate for this use case. Using the shell script below, the random output generated can be copied and pasted into this basic program.
#!/usr/bin/env bashset -e
forlengthin$(seq 1020 1 1030);do
cat /dev/urandom | LC_ALL=C tr -dc '[:alnum:]'| head -c $lengthecho
go run main.go
done
What did you expect to see?
ReadPassword to return when given input greater than 1,023 characters.
What did you see instead?
ReadPassword does not return when given input greater than 1,023 characters.
Conclusion
I'm looking for guidance on how users should paste an input of arbitrarily long length into a CLI program without the input being echoed to the terminal. Thank you very much!
The text was updated successfully, but these errors were encountered:
Closing because I don't think there is anything to fix in the Go package here. For questions about using Go, please see https://go.dev/wiki/Questions. Please comment if you disagree. Thanks.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes. 1.17.6 is the latest release at the time of creation of this issue.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I want the user to paste a JWT token (currently 1,141 characters) via os.Stdin without echoing it on the terminal.
ReadPassword
seemed like a good candidate for this use case. Using the shell script below, the random output generated can be copied and pasted into this basic program.What did you expect to see?
ReadPassword
to return when given input greater than 1,023 characters.What did you see instead?
ReadPassword
does not return when given input greater than 1,023 characters.Conclusion
I'm looking for guidance on how users should paste an input of arbitrarily long length into a CLI program without the input being echoed to the terminal. Thank you very much!
The text was updated successfully, but these errors were encountered: