grub-emu console-read causing issues with the read command
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 returnGRUB_TERM_NO_KEY in the ERR case:
static intgrub_ncurses_getkey (struct grub_term_input *term __attribute__ ((unused))) {
int c;
wtimeout (stdscr, 100); c = getch ();
switch (c)
{
case ERR:< return -1;
Quoted 1 line
return GRUB_TERM_NO_KEY;
--S