X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/3d88e64dfcf5dc0fd361ce0c504c67a9196ce44c..e8e5e30aab4ef90db3c511012bc1a8fa0acebea1:/terminal.c diff --git a/terminal.c b/terminal.c index 362d8b58..23123f88 100644 --- a/terminal.c +++ b/terminal.c @@ -321,8 +321,15 @@ void term_reconfig(Terminal *term, Config *cfg) term->alt_wrap = term->wrap = term->cfg.wrap_mode; if (reset_decom) term->alt_om = term->dec_om = term->cfg.dec_om; - if (reset_bce) + if (reset_bce) { term->use_bce = term->cfg.bce; + if (term->use_bce) + term->erase_char = (' ' | ATTR_ASCII | + (term->curr_attr & + (ATTR_FGMASK | ATTR_BGMASK))); + else + term->erase_char = ERASE_CHAR; + } if (reset_blink) term->blink_is_real = term->cfg.blinktext; if (reset_charclass) @@ -418,6 +425,7 @@ Terminal *term_init(Config *mycfg, struct unicode_data *ucsdata, term->attr_mask = 0xffffffff; term->resize_fn = NULL; term->resize_ctx = NULL; + term->in_term_out = FALSE; return term; } @@ -2603,7 +2611,8 @@ void term_out(Terminal *term) */ break; case 20: - if (term->ldisc) { + if (term->ldisc && + !term->cfg.no_remote_qtitle) { p = get_window_title(term->frontend, TRUE); len = strlen(p); ldisc_send(term->ldisc, "\033]L", 3, 0); @@ -2612,7 +2621,8 @@ void term_out(Terminal *term) } break; case 21: - if (term->ldisc) { + if (term->ldisc && + !term->cfg.no_remote_qtitle) { p = get_window_title(term->frontend,FALSE); len = strlen(p); ldisc_send(term->ldisc, "\033]l", 3, 0); @@ -3554,7 +3564,7 @@ void term_scroll(Terminal *term, int rel, int where) term_update(term); } -static void clipme(Terminal *term, pos top, pos bottom, int rect) +static void clipme(Terminal *term, pos top, pos bottom, int rect, int desel) { wchar_t *workbuf; wchar_t *wbptr; /* where next char goes within workbuf */ @@ -3702,7 +3712,7 @@ static void clipme(Terminal *term, pos top, pos bottom, int rect) wblen++; *wbptr++ = 0; #endif - write_clip(term->frontend, workbuf, wblen, FALSE); /* transfer to clipbd */ + write_clip(term->frontend, workbuf, wblen, desel); /* transfer to clipbd */ if (buflen > 0) /* indicates we allocated this buffer */ sfree(workbuf); } @@ -3712,7 +3722,7 @@ void term_copyall(Terminal *term) pos top; top.y = -sblines(term); top.x = 0; - clipme(term, top, term->curs, 0); + clipme(term, top, term->curs, 0, TRUE); } /* @@ -4177,7 +4187,7 @@ void term_mouse(Terminal *term, Mouse_Button braw, Mouse_Button bcooked, * data to the clipboard. */ clipme(term, term->selstart, term->selend, - (term->seltype == RECTANGULAR)); + (term->seltype == RECTANGULAR), FALSE); term->selstate = SELECTED; } else term->selstate = NO_SELECTION; @@ -4704,17 +4714,19 @@ int term_ldisc(Terminal *term, int option) return FALSE; } -/* - * from_backend(), to get data from the backend for the terminal. - */ -int from_backend(void *vterm, int is_stderr, const char *data, int len) +int term_data(Terminal *term, int is_stderr, const char *data, int len) { - Terminal *term = (Terminal *)vterm; - assert(len > 0); bufchain_add(&term->inbuf, data, len); + if (!term->in_term_out) { + term->in_term_out = TRUE; + term_blink(term, 1); + term_out(term); + term->in_term_out = FALSE; + } + /* * term_out() always completely empties inbuf. Therefore, * there's no reason at all to return anything other than zero