grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Quieten normal mode startup unless a prompt is going to be displ


From: Colin Watson
Subject: [PATCH] Quieten normal mode startup unless a prompt is going to be displayed
Date: Thu, 3 Sep 2009 15:00:48 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Normal mode startup currently displays some text that really only makes
sense if it's about to display a shell prompt. If it ends up displaying
the menu, then that'll set up the screen for itself anyway; but in that
case it really makes no sense to display a help message about BASH-like
line editing being supported.

2009-09-03  Colin Watson  <address@hidden>

        Display normal mode shell introductory message only when it makes
        sense to do so.

        * normal/main.c (grub_normal_reader_init): Rename to ...
        (grub_normal_display_intro): ... this.
        (grub_normal_read_line): Display introductory message if it has not
        yet been displayed.
        (grub_normal_reader): Don't set init method.

Index: normal/main.c
===================================================================
--- normal/main.c       (revision 2561)
+++ normal/main.c       (working copy)
@@ -503,7 +503,7 @@
 }
 
 static grub_err_t
-grub_normal_reader_init (void)
+grub_normal_display_intro (void)
 {
   grub_normal_init_page ();
   grub_setcursor (1);
@@ -524,7 +524,14 @@
 {
   grub_parser_t parser = grub_parser_get_current ();
   char prompt[8 + grub_strlen (parser->name)];
+  static int displayed_intro;
 
+  if (! displayed_intro)
+    {
+      grub_normal_display_intro ();
+      displayed_intro = 1;
+    }
+
   grub_sprintf (prompt, "%s:%s> ", parser->name, (cont) ? "" : "grub");
 
   while (1)
@@ -547,7 +554,6 @@
 static struct grub_reader grub_normal_reader =
   {
     .name = "normal",
-    .init = grub_normal_reader_init,
     .read_line = grub_normal_read_line
   };
 

-- 
Colin Watson                                       address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]