Skip to contentSkip to conversation

Pager weirdness

PATCH Applied Colin Watson 3 participants 4 messages Nov 23, 2010 – Dec 18, 2010

lore
Share & tools
lore
#0 lore raw

Am I the only one who finds GRUB's pager really strange?

I'm used to pagers behaving roughly like 'more' (actually 'less' but never mind that). At the end of a page, you can press Space and you'll get another page of text, or you can press Return and you'll get another line of text. I think most people with experience on Unix-like systems are familiar with this kind of thing.

GRUB's pager is pretty much backwards from this. If you press Return, you get another page of text. If you press Space, the comment in grub-core/normal/term.c says that you should get another "one lines" (sic) of text, but in fact you get two more lines.

How about something like this? This seems to behave a lot more naturally for me. Am I missing some subtle detail?

2010-11-23 Colin Watson <[email protected]>

* grub-core/normal/term.c (print_more): Make \r or \n scroll one line, and other keys scroll an entire page (previous handling was for \r and \n to scroll a page and other keys to scroll two lines).

=== modified file 'grub-core/normal/term.c'

normal/term.c +4 -4
@@ -91,16 +91,16 @@ print_more (void)
   grub_term_restore_pos (pos);
   grub_free (pos);
 
-  /* Scroll one lines or an entire page, depending on the key.  */
+  /* Scroll one line or an entire page, depending on the key.  */
 
   if (key == '\r' || key =='\n')
-    grub_normal_reset_more ();
-  else
     {
       static struct term_state *state;
       for (state = term_states; state; state = state->next)
-	state->num_lines -= 2;
+	state->num_lines--;
     }
+  else
+    grub_normal_reset_more ();
 }
 
 void

Thanks,

Signature · 1 line
Colin Watson                                       [[email protected]]
#1 lore raw

+100000 :).

Quoted 56 lines · Colin Watson

Am I the only one who finds GRUB's pager really strange?

I'm used to pagers behaving roughly like 'more' (actually 'less' but never mind that). At the end of a page, you can press Space and you'll get another page of text, or you can press Return and you'll get another line of text. I think most people with experience on Unix-like systems are familiar with this kind of thing.

GRUB's pager is pretty much backwards from this. If you press Return, you get another page of text. If you press Space, the comment in grub-core/normal/term.c says that you should get another "one lines" (sic) of text, but in fact you get two more lines.

How about something like this? This seems to behave a lot more naturally for me. Am I missing some subtle detail?

2010-11-23 Colin Watson <[email protected]>

* grub-core/normal/term.c (print_more): Make \r or \n scroll one line, and other keys scroll an entire page (previous handling was for \r and \n to scroll a page and other keys to scroll two lines).

=== modified file 'grub-core/normal/term.c'

normal/term.c 2010-11-23 13:24:33 +0000 renamed from normal/term.c 2010-09-30 19:04:09 +0000 +4 -4
@@ -91,16 +91,16 @@ print_more (void)
  grub_term_restore_pos (pos);
  grub_free (pos);
 
-  /* Scroll one lines or an entire page, depending on the key.  */
+  /* Scroll one line or an entire page, depending on the key.  */
 
  if (key == '\r' || key =='\n')
-    grub_normal_reset_more ();
-  else
    {
      static struct term_state *state;
      for (state = term_states; state; state = state->next)
-    state->num_lines -= 2;
+    state->num_lines--;
    }
+  else
+    grub_normal_reset_more ();
 }
 

void

Thanks,

Signature · 6 lines
Colin Watson                                       [[email protected]]

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
#2 lore raw
In reply to Colin Watson
Quoted 1 line · Colin Watson

Am I the only one who finds GRUB's pager really strange?

Not AT ALL. :)

It reminds me of how some things misbehave when you have to suffer bterm.

Signature · 3 lines
Jordi Mallach Pérez  --  Debian developer     http://www.debian.org/
[email protected]     [email protected]     http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/
author Applied
#3 lore raw
In reply to Colin Watson
Quoted 5 lines · Colin Watson

2010-11-23 Colin Watson <[email protected]>

* grub-core/normal/term.c (print_more): Make \r or \n scroll one line, and other keys scroll an entire page (previous handling was for \r and \n to scroll a page and other keys to scroll two lines).

Applied to trunk following an ack from Vladimir on IRC.

Signature · 1 line
Colin Watson                                       [[email protected]]