+/*
+ * Terminal emulator.
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
!= newline[j].attr) {
int k;
- for (k = laststart; k < j; k++)
- term->disptext[i]->chars[k].attr |= ATTR_INVALID;
+ if (!dirtyrect) {
+ for (k = laststart; k < j; k++)
+ term->disptext[i]->chars[k].attr |= ATTR_INVALID;
- dirtyrect = TRUE;
+ dirtyrect = TRUE;
+ }
}
if (dirtyrect)
selpoint.x = x;
unlineptr(ldata);
- if (raw_mouse) {
+ /*
+ * If we're in the middle of a selection operation, we ignore raw
+ * mouse mode until it's done (we must have been not in raw mouse
+ * mode when it started).
+ * This makes use of Shift for selection reliable, and avoids the
+ * host seeing mouse releases for which they never saw corresponding
+ * presses.
+ */
+ if (raw_mouse &&
+ (term->selstate != ABOUT_TO) && (term->selstate != DRAGGING)) {
int encstate = 0, r, c;
char abuf[16];