vte: add auto-wrap support
VT510 manual says auto-wrap is disabled by default but most applications (including bash) expect it to be on, therefore we enable it by default. The console layer already supported it but the vte layer wasn't hooked up. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
860e7ff509
commit
addaa40562
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user