shared/ask-password-api: show "(press TAB for no echo)"
For #8495: it is arguably useful to not show the length of the password in public spaces. It is possible to press TAB or BS to cancel the asterisks, but this is not very discoverable. Let's make it discoverable by showing a message (in gray). The message is "erased" after the first character is entered.
This commit is contained in:
@@ -8,7 +8,7 @@ static void test_ask_password(void) {
|
||||
int r;
|
||||
_cleanup_strv_free_ char **ret = NULL;
|
||||
|
||||
r = ask_password_tty(-1, "hello?", "da key", 0, 0, NULL, &ret);
|
||||
r = ask_password_tty(-1, "hello?", "da key", 0, ASK_PASSWORD_CONSOLE_COLOR, NULL, &ret);
|
||||
if (r == -ECANCELED)
|
||||
assert_se(ret == NULL);
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user