Hi,

When using the read command under grub-emu, the resulting value read (present in the environment variable) includes a time-dependent number of 0xff characters + the input that the user made. I tracked it down to grub_ncurses_getkey(), which times out after 100ms and causes grub_ncurses_getkey to return -1 instead of GRUB_TERM_NO_KEY, which causes grub_getkey() to return -1 instead of blocking until it has real input.

My suggestion would be to change grub_ncurses_getkey to return GRUB_TERM_NO_KEY in the ERR case:

static int
grub_ncurses_getkey (struct grub_term_input *term __attribute__ ((unused)))
{
  int c;

  wtimeout (stdscr, 100);
  c = getch ();

  switch (c)
    {
    case ERR:
<      return -1;
     return GRUB_TERM_NO_KEY;

 --S


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to