On soft-reset we reset the console to the initial state but keep current
line-state. That is, scrollback and cursor position are kept but the
non-visible state is reset.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
void kmscon_console_reset(struct kmscon_console *con)
{
+ unsigned int i;
+
if (!con)
return;
- /* TODO: reset console */
+ con->flags = 0;
+ con->margin_top = 0;
+ con->margin_bottom = con->size_y - 1;
+
+ for (i = 0; i < con->size_y; ++i) {
+ if (i % 8 == 0)
+ con->tab_ruler[i] = true;
+ else
+ con->tab_ruler[i] = false;
+ }
}
void kmscon_console_set_flags(struct kmscon_console *con, unsigned int flags)
vte->flags |= FLAG_AUTO_REPEAT_MODE;
vte->flags |= FLAG_SEND_RECEIVE_MODE;
vte->flags |= FLAG_AUTO_WRAP_MODE;
- kmscon_console_reset_flags(vte->con, ~0);
+ kmscon_console_reset(vte->con);
kmscon_console_set_flags(vte->con, KMSCON_CONSOLE_AUTO_WRAP);
- kmscon_console_set_margins(vte->con, 0, 0);
kmscon_utf8_mach_reset(vte->mach);
vte->state = STATE_GROUND;