mirror of
https://github.com/vivier/EMILE.git
synced 2025-02-08 05:30:34 +00:00
Use console_cursor_on(), console_cursor_off(), console_cursor_save(), console_cursor_restore()
This commit is contained in:
parent
95e99c5c24
commit
4222e48572
20
second/cli.c
20
second/cli.c
@ -25,11 +25,12 @@ void cli_edit(char *s, int length)
|
||||
for (i = l; i > pos; i--)
|
||||
s[i] = s[i - 1];
|
||||
s[pos] = c;
|
||||
printf("%s", s + pos);
|
||||
l++;
|
||||
putchar(c);
|
||||
pos++;
|
||||
for (i = l; i > pos; i--)
|
||||
putchar('\b');
|
||||
l++;
|
||||
console_cursor_save();
|
||||
printf("%s", s + pos);
|
||||
console_cursor_restore();
|
||||
}
|
||||
else switch(c)
|
||||
{
|
||||
@ -52,12 +53,12 @@ void cli_edit(char *s, int length)
|
||||
{
|
||||
putchar('\b');
|
||||
pos--;
|
||||
l--;
|
||||
strcpy(s + pos, s + pos + 1);
|
||||
console_cursor_save();
|
||||
printf("%s", s + pos);
|
||||
putchar(' ');
|
||||
for (i = l; i > pos; i--)
|
||||
putchar('\b');
|
||||
l--;
|
||||
console_cursor_restore();
|
||||
}
|
||||
break;
|
||||
case 0x7f: /* Delete */
|
||||
@ -65,9 +66,10 @@ void cli_edit(char *s, int length)
|
||||
{
|
||||
strcpy(s + pos, s + pos + 1);
|
||||
l--;
|
||||
console_cursor_save();
|
||||
printf("%s", s + pos);
|
||||
for (i = l; i > pos; i--)
|
||||
putchar('\b');
|
||||
putchar(' ');
|
||||
console_cursor_restore();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -167,12 +167,16 @@ int start(emile_l2_header_t* info)
|
||||
if (info->kernel_image_size == 0)
|
||||
error("Kernel is missing !!!!\n");
|
||||
|
||||
printf("Parameters: %s", info->command_line);
|
||||
printf("Parameters: ");
|
||||
console_cursor_save();
|
||||
printf("%s", info->command_line);
|
||||
console_cursor_on();
|
||||
if (console_keypressed(5 * 60))
|
||||
{
|
||||
printf("\rParameters: ");
|
||||
console_cursor_restore();
|
||||
cli_edit(info->command_line, CL_SIZE);
|
||||
}
|
||||
console_cursor_off();
|
||||
putchar('\n');
|
||||
#ifdef SCSI_SUPPORT
|
||||
info->kernel_image_offset = (unsigned long)info->kernel_image_offset + (unsigned long)info;
|
||||
|
Loading…
x
Reference in New Issue
Block a user