Hello, all.
How can I hide the user’s password input using asterisk?
For example,
To make it
44> io:fread('Password> ', "~s").
Password> pwd
{ok,["pwd"]}
look like
44> io:fread('Password> ', "~s").
Password> ***
{ok,["pwd"]}
I found 2 functions in the module /path/to/otp//lib/stdlib/src/io.erl
393 -doc false.
394 get_password() ->
395 get_password(default_input()).
396
397 -doc false.
398 get_password(Io) ->
399 request(Io, {get_password,unicode}).
45> io:get_password().
"pwd"
46> io:get_password(standard_io).
"pwd"
They do without an asterisk.
There is no documentation on them here stdlib/io.
Why are they missing from the documentation?
I also found that it is possible to disable echo
using io:setopts/1, io:setopts/2
functions.