Skip to contentSkip to conversation

gfxterm/pager regression

DISCUSSION Colin Watson 2 participants 3 messages Jul 5, 2010 – Jul 6, 2010

lore
Share & tools
lore
#0 lore raw

gfxterm is behaving very oddly for me with 'set pager=1' right now; the --MORE-- prompt appears after only a few lines of text have been output. It looks rather as if it is counting the number of output characters as if they were the number of output lines. This doesn't happen when the terminal output is an ordinary VGA console.

Looking at normal/term.c:put_glyphs_terminal, it seems that it increments state->num_lines after every glyph. This seems pretty odd. Doesn't it need to do something a bit smarter than that? Vladimir, is this a regression from your bidi branch merge?

Thanks,

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

gfxterm is behaving very oddly for me with 'set pager=1' right now; the --MORE-- prompt appears after only a few lines of text have been output. It looks rather as if it is counting the number of output characters as if they were the number of output lines. This doesn't happen when the terminal output is an ordinary VGA console.

Quoted 6 lines

Looking at normal/term.c:put_glyphs_terminal, it seems that it increments state->num_lines after every glyph. This seems pretty odd. Doesn't it need to do something a bit smarter than that? Vladimir, is this a regression from your bidi branch merge?

Looks this way. Please test attached patch.

Quoted 3 lines

Thanks,

Signature · 2 lines
Regards
Vladimir 'φ-coder/phcoder' Serbinenko

=== modified file 'normal/term.c'

term.c +11 -9
@@ -616,16 +616,18 @@
       if (visual_ptr->base == '\n')
 	grub_print_spaces (term, margin_right);
       putglyph (visual_ptr, term);
-      if (state && ++state->num_lines
-	  >= (grub_ssize_t) grub_term_height (term) - 2)
-      {
-	state->backlog_glyphs = visual_ptr + 1;
-	state->backlog_len = visual_len - (visual - visual_ptr) - 1;
-	return 1;
-      }
+      if (visual_ptr->base == '\n')
+	{
+	  if (state && ++state->num_lines
+	      >= (grub_ssize_t) grub_term_height (term) - 2)
+	    {
+	      state->backlog_glyphs = visual_ptr + 1;
+	      state->backlog_len = visual_len - (visual - visual_ptr) - 1;
+	      return 1;
+	    }
 
-      if (visual_ptr->base == '\n')
-	grub_print_spaces (term, margin_left);
+	  grub_print_spaces (term, margin_left);
+	}
       grub_free (visual_ptr->combining);
     }
   return 0;
#2 lore raw
Quoted 7 lines · Vladimir 'φ-coder/phcoder' Serbinenko
Quoted 6 lines · Colin Watson

gfxterm is behaving very oddly for me with 'set pager=1' right now; the --MORE-- prompt appears after only a few lines of text have been output. It looks rather as if it is counting the number of output characters as if they were the number of output lines. This doesn't happen when the terminal output is an ordinary VGA console.

Quoted 6 lines
Quoted 4 lines

Looking at normal/term.c:put_glyphs_terminal, it seems that it increments state->num_lines after every glyph. This seems pretty odd. Doesn't it need to do something a bit smarter than that? Vladimir, is this a regression from your bidi branch merge?

Looks this way. Please test attached patch.

This looks good and works much better. Thanks!

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