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