newsavelines == term->savelines)
return; /* nothing to do */
+ /* Behave sensibly if we're given zero (or negative) rows/cols */
+
+ if (newrows < 1) newrows = 1;
+ if (newcols < 1) newcols = 1;
+
deselect(term);
swap_screen(term, 0, FALSE, FALSE);
* Perform an actual beep if we're not overloaded.
*/
if (!term->cfg.bellovl || !term->beep_overloaded) {
- beep(term->frontend, term->cfg.beep);
+ do_beep(term->frontend, term->cfg.beep);
if (term->cfg.beep == BELL_VISUAL) {
term_schedule_vbell(term, FALSE, 0);
int old_top_x;
int wblen = 0; /* workbuf len */
int buflen; /* amount of memory allocated to workbuf */
+ int *attrbuf; /* Attribute buffer */
+ int *attrptr;
+ int attr;
buflen = 5120; /* Default size */
workbuf = snewn(buflen, wchar_t);
+ attrbuf = buflen ? snewn(buflen, int) : 0;
wbptr = workbuf; /* start filling here */
+ attrptr = attrbuf;
old_top_x = top.x; /* needed for rect==1 */
while (poslt(top, bottom)) {
while (1) {
int uc = ldata->chars[x].chr;
+ attr = ldata->chars[x].attr;
switch (uc & CSET_MASK) {
case CSET_LINEDRW:
buflen += 100;
workbuf = sresize(workbuf, buflen, wchar_t);
wbptr = workbuf + wblen;
+ attrbuf = sresize(attrbuf, buflen, int);
+ attrptr = attrbuf + wblen;
}
wblen++;
*wbptr++ = *p;
+ *attrptr++ = attr;
}
if (ldata->chars[x].cc_next)
for (i = 0; i < sel_nl_sz; i++) {
wblen++;
*wbptr++ = sel_nl[i];
+ *attrptr++ = 0;
}
}
top.y++;
wblen++;
*wbptr++ = 0;
#endif
- write_clip(term->frontend, workbuf, wblen, desel); /* transfer to clipbd */
+ write_clip(term->frontend, workbuf, attrbuf, wblen, desel); /* transfer to clipbd */
if (buflen > 0) /* indicates we allocated this buffer */
sfree(workbuf);
}
/* Immediate abort. */
term_data(term, 0, "\r\n", 2);
sfree(s);
+ p->data = NULL;
return 0; /* user abort */
default:
/*
return -1; /* more data required */
} else {
sfree(s);
+ p->data = NULL;
return +1; /* all done */
}
}