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)
term->attr_mask = 0xffffffff;
term->resize_fn = NULL;
term->resize_ctx = NULL;
+ term->in_term_out = FALSE;
return 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);
}
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);
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 */
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);
}
pos top;
top.y = -sblines(term);
top.x = 0;
- clipme(term, top, term->curs, 0);
+ clipme(term, top, term->curs, 0, TRUE);
}
/*
* 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;
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