X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=terminal.c;h=7b69e06ee4cef121ae5f8b74f80aa907a0daec5b;hb=f1ece56e40435efdf8eaeb2b11b34d73ee3f4a22;hp=2962b0a0be41c5a052a27d7e20f85bb680b3a029;hpb=3ed0d44f163722e1eb256e02419a832bcedc61cc;p=PuTTY.git diff --git a/terminal.c b/terminal.c index 2962b0a0..7b69e06e 100644 --- a/terminal.c +++ b/terminal.c @@ -99,7 +99,7 @@ static int wrap, wrapnext; /* wrap flags */ static int insert; /* insert-mode flag */ static int cset; /* 0 or 1: which char set */ static int save_cset, save_csattr; /* saved with cursor position */ -static int save_utf; /* saved with cursor position */ +static int save_utf, save_wnext; /* saved with cursor position */ static int rvideo; /* global reverse video flag */ static unsigned long rvbell_startpoint;/* for ESC[?5hESC[?5l vbell */ static int cursor_on; /* cursor enabled flag */ @@ -746,6 +746,7 @@ static void save_cursor(int save) save_attr = curr_attr; save_cset = cset; save_utf = utf; + save_wnext = wrapnext; save_csattr = cset_attr[cset]; save_sco_acs = sco_acs; } else { @@ -759,6 +760,13 @@ static void save_cursor(int save) curr_attr = save_attr; cset = save_cset; utf = save_utf; + wrapnext = save_wnext; + /* + * wrapnext might reset to False if the x position is no + * longer at the rightmost edge. + */ + if (wrapnext && curs.x < cols-1) + wrapnext = FALSE; cset_attr[cset] = save_csattr; sco_acs = save_sco_acs; fix_cpos; @@ -1993,8 +2001,8 @@ void term_out(void) break; case 8: if (esc_nargs >= 3) { - request_resize(def(esc_args[1], cfg.width), - def(esc_args[2], cfg.height)); + request_resize(def(esc_args[2], cfg.width), + def(esc_args[1], cfg.height)); } break; case 9: @@ -2017,7 +2025,7 @@ void term_out(void) break; case 18: len = sprintf(buf, "\033[8;%d;%dt", - cols, rows); + rows, cols); ldisc_send(buf, len, 0); break; case 19: @@ -3603,6 +3611,8 @@ int term_ldisc(int option) */ int from_backend(int is_stderr, char *data, int len) { + assert(len > 0); + bufchain_add(&inbuf, data, len); /*