firstboot: clean up welcome message
authorMichael Ferrari <nekkodroid404@gmail.com>
Tue, 8 Oct 2024 16:58:04 +0000 (18:58 +0200)
committerMichael Ferrari <nekkodroid404@gmail.com>
Wed, 30 Oct 2024 19:13:47 +0000 (20:13 +0100)
src/firstboot/firstboot.c

index 6bec3ca65104f4ce5b7392e40d899153c7170f85..2877623ae9621035a6f3b488e144b4bb989da0c3 100644 (file)
@@ -104,8 +104,10 @@ static void print_welcome(int rfd) {
         if (!arg_welcome)
                 return;
 
-        if (done)
+        if (done) {
+                putchar('\n'); /* Add some breathing room between multiple prompts */
                 return;
+        }
 
         r = parse_os_release_at(rfd,
                                 "PRETTY_NAME", &pretty_name,
@@ -614,7 +616,6 @@ static int prompt_hostname(int rfd) {
         }
 
         print_welcome(rfd);
-        putchar('\n');
 
         for (;;) {
                 _cleanup_free_ char *h = NULL;
@@ -728,7 +729,6 @@ static int prompt_root_password(int rfd) {
         }
 
         print_welcome(rfd);
-        putchar('\n');
 
         msg1 = strjoina(special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), " Please enter a new root password (empty to skip):");
         msg2 = strjoina(special_glyph(SPECIAL_GLYPH_TRIANGULAR_BULLET), " Please enter new root password again:");
@@ -821,7 +821,6 @@ static int prompt_root_shell(int rfd) {
         }
 
         print_welcome(rfd);
-        putchar('\n');
 
         for (;;) {
                 _cleanup_free_ char *s = NULL;