43 |
console_cls, |
console_cls, |
44 |
console_setcolorstate, |
console_setcolorstate, |
45 |
console_setcolor, |
console_setcolor, |
46 |
console_nocursor |
console_setcursor |
47 |
}, |
}, |
48 |
#ifdef SUPPORT_SERIAL |
#ifdef SUPPORT_SERIAL |
49 |
{ |
{ |
73 |
hercules_cls, |
hercules_cls, |
74 |
hercules_setcolorstate, |
hercules_setcolorstate, |
75 |
hercules_setcolor, |
hercules_setcolor, |
76 |
hercules_nocursor |
hercules_setcursor |
77 |
}, |
}, |
78 |
#endif /* SUPPORT_HERCULES */ |
#endif /* SUPPORT_HERCULES */ |
79 |
/* This must be the last entry. */ |
/* This must be the last entry. */ |
790 |
get_cmdline (char *prompt, char *cmdline, int maxlen, |
get_cmdline (char *prompt, char *cmdline, int maxlen, |
791 |
int echo_char, int readline) |
int echo_char, int readline) |
792 |
{ |
{ |
793 |
|
int old_cursor; |
794 |
|
int ret; |
795 |
|
|
796 |
|
old_cursor = setcursor (1); |
797 |
|
|
798 |
/* Because it is hard to deal with different conditions simultaneously, |
/* Because it is hard to deal with different conditions simultaneously, |
799 |
less functional cases are handled here. Assume that TERM_NO_ECHO |
less functional cases are handled here. Assume that TERM_NO_ECHO |
800 |
implies TERM_NO_EDIT. */ |
implies TERM_NO_EDIT. */ |
816 |
{ |
{ |
817 |
/* Return immediately if ESC is pressed. */ |
/* Return immediately if ESC is pressed. */ |
818 |
if (c == 27) |
if (c == 27) |
819 |
return 1; |
{ |
820 |
|
setcursor (old_cursor); |
821 |
|
return 1; |
822 |
|
} |
823 |
|
|
824 |
/* Printable characters are added into CMDLINE. */ |
/* Printable characters are added into CMDLINE. */ |
825 |
if (c >= ' ' && c <= '~') |
if (c >= ' ' && c <= '~') |
837 |
|
|
838 |
if (! (current_term->flags & TERM_NO_ECHO)) |
if (! (current_term->flags & TERM_NO_ECHO)) |
839 |
grub_putchar ('\n'); |
grub_putchar ('\n'); |
840 |
|
|
841 |
|
setcursor (old_cursor); |
842 |
return 0; |
return 0; |
843 |
} |
} |
844 |
|
|
845 |
/* Complicated features are left to real_get_cmdline. */ |
/* Complicated features are left to real_get_cmdline. */ |
846 |
return real_get_cmdline (prompt, cmdline, maxlen, echo_char, readline); |
ret = real_get_cmdline (prompt, cmdline, maxlen, echo_char, readline); |
847 |
|
setcursor (old_cursor); |
848 |
|
return ret; |
849 |
} |
} |
850 |
#endif /* STAGE1_5 */ |
#endif /* STAGE1_5 */ |
851 |
|
|
1089 |
current_term->cls (); |
current_term->cls (); |
1090 |
} |
} |
1091 |
|
|
1092 |
void |
int |
1093 |
nocursor (void) |
setcursor (int on) |
1094 |
{ |
{ |
1095 |
if (current_term->nocursor) |
if (current_term->setcursor) |
1096 |
current_term->nocursor (); |
return current_term->setcursor (on); |
1097 |
|
|
1098 |
|
return 1; |
1099 |
} |
} |
1100 |
#endif /* ! STAGE1_5 */ |
#endif /* ! STAGE1_5 */ |
1101 |
|
|