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:
Zbigniew Jędrzejewski-Szmek
2020-02-06 10:51:24 +01:00
parent 72c08a471c
commit 8aaf18e08a
2 changed files with 22 additions and 5 deletions
+1 -1
View File
@@ -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 {