(get_cmdline, cl_refresh): If TERMINAL_DUMB
section is always 0. Line is only cleared if !TERMINAL_DUMB.
This commit is contained in:
parent
ca6e068bb9
commit
3190c1f483
1 changed files with 41 additions and 37 deletions
|
@ -385,7 +385,8 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
|
||||||
if (full)
|
if (full)
|
||||||
{
|
{
|
||||||
/* Recompute the section number. */
|
/* Recompute the section number. */
|
||||||
if (lpos + plen < CMDLINE_WIDTH)
|
if ((terminal & TERMINAL_DUMB)
|
||||||
|
|| (lpos + plen < CMDLINE_WIDTH))
|
||||||
section = 0;
|
section = 0;
|
||||||
else
|
else
|
||||||
section = ((lpos + plen - CMDLINE_WIDTH)
|
section = ((lpos + plen - CMDLINE_WIDTH)
|
||||||
|
@ -448,48 +449,51 @@ get_cmdline (char *prompt, char *cmdline, int maxlen,
|
||||||
|
|
||||||
pos++;
|
pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fill up the rest of the line with spaces. */
|
if (! (terminal & TERMINAL_DUMB))
|
||||||
for (; i < start + len; i++)
|
|
||||||
{
|
{
|
||||||
grub_putchar (' ');
|
/* Fill up the rest of the line with spaces. */
|
||||||
pos++;
|
for (; i < start + len; i++)
|
||||||
}
|
{
|
||||||
|
grub_putchar (' ');
|
||||||
/* If the cursor is at the last position, put `>' or a space,
|
pos++;
|
||||||
depending on if there are more characters in BUF. */
|
}
|
||||||
if (pos == CMDLINE_WIDTH)
|
|
||||||
{
|
|
||||||
if (start + len < llen)
|
|
||||||
grub_putchar ('>');
|
|
||||||
else
|
|
||||||
grub_putchar (' ');
|
|
||||||
|
|
||||||
pos++;
|
/* If the cursor is at the last position, put `>' or a space,
|
||||||
}
|
depending on if there are more characters in BUF. */
|
||||||
|
if (pos == CMDLINE_WIDTH)
|
||||||
/* Back to XPOS. */
|
{
|
||||||
if ((terminal & TERMINAL_CONSOLE)
|
if (start + len < llen)
|
||||||
|
grub_putchar ('>');
|
||||||
|
else
|
||||||
|
grub_putchar (' ');
|
||||||
|
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Back to XPOS. */
|
||||||
|
if ((terminal & TERMINAL_CONSOLE)
|
||||||
# ifdef SUPPORT_HERCULES
|
# ifdef SUPPORT_HERCULES
|
||||||
|| (terminal & TERMINAL_HERCULES)
|
|| (terminal & TERMINAL_HERCULES)
|
||||||
# endif /* SUPPORT_HERCULES */
|
# endif /* SUPPORT_HERCULES */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
int y = getxy () & 0xFF;
|
int y = getxy () & 0xFF;
|
||||||
|
|
||||||
gotoxy (xpos, y);
|
gotoxy (xpos, y);
|
||||||
}
|
}
|
||||||
# ifdef SUPPORT_SERIAL
|
# ifdef SUPPORT_SERIAL
|
||||||
else if (! (terminal & TERMINAL_SERIAL) && (pos - xpos > 4))
|
else if (! (terminal & TERMINAL_SERIAL) && (pos - xpos > 4))
|
||||||
{
|
{
|
||||||
grub_printf ("\e[%dD", pos - xpos);
|
grub_printf ("\e[%dD", pos - xpos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (i = 0; i < pos - xpos; i++)
|
for (i = 0; i < pos - xpos; i++)
|
||||||
grub_putchar ('\b');
|
grub_putchar ('\b');
|
||||||
}
|
}
|
||||||
# endif /* SUPPORT_SERIAL */
|
# endif /* SUPPORT_SERIAL */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize the command-line. */
|
/* Initialize the command-line. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue