bug-grub
[Top][All Lists]
Advanced

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

Re: proposition for more


From: Christoph Plattner
Subject: Re: proposition for more
Date: Mon, 11 Feb 2002 08:59:20 +0100

Hello !

The initial idea was to use <ENTER> only to have equal 
handling in dumb terminals and in non-dumb terminals.
A abort <ESC> is quite a good idea, but may also be
difficult on dumb terminals (or cannonical one's).

We should discuss:
- what options do we really need, GRUB is not an OS to
  develop C code or similar
- what we want to have - ok, "less" as a dream - especially
  jumping back ...
- what can we do, not having a full blown terminal support
  with all knowledge of sizes, etc
- supporting also terminals as dumb and cannonical one's
  like running a terminal emulation out of emacs.

BTW: I like the current implementation, as it fullfills the
basic need, and it is much more, we usually have as comfort
in a boot loader !

Bye
Christoph P.


------------------------------------------------------------------
private:  address@hidden
company:  address@hidden


Jani Averbach wrote:
> 
> Hi!
> 
> I have made a little modification to grub, so that it's cat has some of
> more's capabilities
> (space = next screen, return = next line, esc = ending, line wrapping).
> 
> What do you think, does grub need more? =)
> And if it does, cat with more or cat and more?
> 
> Q1: How should I print to place (x,y) = (80,y) in the screen?
> grub_putchar() seems make shift when place 80 has been reached.
> 
> Q2: There is no predefined max size for terminal, is there?
> 
> Here is the story so far:
> 
> (builtins.c: 402)
> 
> #define JAA_TERM_X_SIZE 80
> #define JAA_TERM_Y_SIZE 25
> /* cat */
> static int
> cat_func (char *arg, int flags)
> {
>   char c;
>   int key;
>   int lines = 0;
>   int linechars = 0;
> 
>   if (! grub_open (arg))
>     return 1;
> 
>   while (grub_read (&c, 1)){
> 
>       if ('\n' == c){
>           linechars = 0;
>           ++lines;
>       }
> 
>       if (linechars > JAA_TERM_X_SIZE-1){
>           grub_putchar ('\n');
>           ++lines;
>           linechars = 0;
>       }
>       else
>           ++linechars;
> 
>       if (lines > JAA_TERM_Y_SIZE-1){
>           key = getkey();
>           /* If ESC is returned, then abort this entry.  */
>           if (ASCII_CHAR (key) == 27)
>               break;
>           /* if ENTER is returned, then scroll down by one */
>           else if(ASCII_CHAR (key) == 10 || ASCII_CHAR(key) == 13)
>               --lines;
>           else
>               lines = 0;
>       }
> 
>       grub_putchar (c);
>   }
> 
>   grub_close ();
>   return 0;
> }
> #undef JAA_TERM_X_SIZE 80
> #undef JAA_TERM_Y_SIZE 25
> 
> BR, Jani
> 
> --
> Jani Averbach
> 
> _______________________________________________
> Bug-grub mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-grub

------------------------------------------------------------------
private:  address@hidden
company:  address@hidden



reply via email to

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