Closed jeroen closed 7 years ago
Thanks for the suggestion. If I understand correctly, you're proposing separate returns for "canceling" and entering a blank? Right now for all the readers, both actions return NULL
. What would you have in mind? Maybe NULL
for cancel and character(0)
for a blank? The only real downside I guess is the increased complexity in handling degenerate cases.
If that sounds reasonable, I can change the terminal and tcltk ones easily enough, but have no control over RStudio's. Do you know who would be the person there to ask about possibly incorporating such a change?
No not really. My suggestion was mostly that maybe this should be a parameter in getPass()
to control whether or not a blank value is allowed.
Ah, I see; good idea. I've added that option to the terminal reader, and I'll ask the RStudio folks about things on their side.
Seems to be fixed on RStudio's end.
There is an important distinction on whether or not the password entry requires a password or not. For example when you are asking the user to set a password, you might want to explicitly allow the user to set no password by leaving the dialog box blank. Currently the rstudio prompt does not allow for this.
On the other hand, in an application where some feature is password protected, leaving the password blank might not make sense, and you might want to require the user to enter something.