mirror of https://github.com/xqemu/xqemu.git
readline: Clear screen on form feed.
Signed-off-by: Hani Benhabiles <hani@linux.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
b21631f3b5
commit
075ccb6cd3
|
@ -351,6 +351,12 @@ static void readline_completion(ReadLineState *rs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void readline_clear_screen(ReadLineState *rs)
|
||||||
|
{
|
||||||
|
rs->printf_func(rs->opaque, "\033[2J\033[1;1H");
|
||||||
|
readline_show_prompt(rs);
|
||||||
|
}
|
||||||
|
|
||||||
/* return true if command handled */
|
/* return true if command handled */
|
||||||
void readline_handle_byte(ReadLineState *rs, int ch)
|
void readline_handle_byte(ReadLineState *rs, int ch)
|
||||||
{
|
{
|
||||||
|
@ -369,6 +375,9 @@ void readline_handle_byte(ReadLineState *rs, int ch)
|
||||||
case 9:
|
case 9:
|
||||||
readline_completion(rs);
|
readline_completion(rs);
|
||||||
break;
|
break;
|
||||||
|
case 12:
|
||||||
|
readline_clear_screen(rs);
|
||||||
|
break;
|
||||||
case 10:
|
case 10:
|
||||||
case 13:
|
case 13:
|
||||||
rs->cmd_buf[rs->cmd_buf_size] = '\0';
|
rs->cmd_buf[rs->cmd_buf_size] = '\0';
|
||||||
|
|
Loading…
Reference in New Issue