diff --git a/src/console.c b/src/console.c index eefd572..d21f2ff 100644 --- a/src/console.c +++ b/src/console.c @@ -98,7 +98,6 @@ struct kmscon_console { /* console cells */ struct kmscon_buffer *cells; bool rel_addr; /* is relative addressing used? */ - bool auto_wrap; /* auto wrap on end of line? */ /* cursor */ unsigned int cursor_x; @@ -982,7 +981,6 @@ int kmscon_console_new(struct kmscon_console **out) memset(con, 0, sizeof(*con)); con->ref = 1; - con->auto_wrap = true; ret = kmscon_buffer_new(&con->cells, 0, 0); if (ret) @@ -1067,7 +1065,7 @@ void kmscon_console_write(struct kmscon_console *con, kmscon_symbol_t ch, last = con->cells->scroll_y + con->cells->mtop_y; if (con->cursor_x >= con->cells->size_x) { - if (con->auto_wrap) { + if (flags & KMSCON_CONSOLE_WRAP) { con->cursor_x = 0; con->cursor_y++; if (con->cursor_y >= last) { diff --git a/src/console.h b/src/console.h index 8528b8d..fe65eb9 100644 --- a/src/console.h +++ b/src/console.h @@ -45,6 +45,7 @@ struct kmscon_console; /* console objects */ #define KMSCON_CONSOLE_INSERT 0x01 +#define KMSCON_CONSOLE_WRAP 0x02 int kmscon_console_new(struct kmscon_console **out); void kmscon_console_ref(struct kmscon_console *con); diff --git a/src/vte.c b/src/vte.c index e132b46..314c8a4 100644 --- a/src/vte.c +++ b/src/vte.c @@ -269,6 +269,8 @@ static void write_console(struct kmscon_vte *vte, kmscon_symbol_t sym) flags = 0; if (vte->flags & FLAG_INSERT_REPLACE_MODE) flags |= KMSCON_CONSOLE_INSERT; + if (vte->flags & FLAG_AUTO_WRAP_MODE) + flags |= KMSCON_CONSOLE_WRAP; kmscon_console_write(vte->con, sym, &vte->cattr, flags); } @@ -288,6 +290,7 @@ void kmscon_vte_reset(struct kmscon_vte *vte) vte->flags |= FLAG_TEXT_CURSOR_MODE; vte->flags |= FLAG_AUTO_REPEAT_MODE; vte->flags |= FLAG_SEND_RECEIVE_MODE; + vte->flags |= FLAG_AUTO_WRAP_MODE; kmscon_utf8_mach_reset(vte->mach); vte->state = STATE_GROUND;