Handlers for a number of escape sequences, notably including ESC[J and
the sequences that switch to/from the alternate screen, were
unconditionally resetting the scrollback instead of first checking the
'Reset scrollback on display activity' configuration option. I've
added the missing if statements, so now 'Reset scrollback on display
activity' should actually mean what it says.
For example, this would have inconvenienced an mplayer user, who
wouldn't be able to go up and check their scrollback while mplayer was
repeatedly redisplaying its status line, because mplayer uses ESC[J to
erase each version of the status line before printing the next
version.
[originally from svn r10125]
compatibility(OTHER);
deselect(term);
swap_screen(term, term->no_alt_screen ? 0 : state, FALSE, FALSE);
compatibility(OTHER);
deselect(term);
swap_screen(term, term->no_alt_screen ? 0 : state, FALSE, FALSE);
+ if (term->scroll_on_disp)
+ term->disptop = 0;
break;
case 1000: /* xterm mouse 1 (normal) */
term->xterm_mouse = state ? 1 : 0;
break;
case 1000: /* xterm mouse 1 (normal) */
term->xterm_mouse = state ? 1 : 0;
compatibility(OTHER);
deselect(term);
swap_screen(term, term->no_alt_screen ? 0 : state, TRUE, TRUE);
compatibility(OTHER);
deselect(term);
swap_screen(term, term->no_alt_screen ? 0 : state, TRUE, TRUE);
+ if (term->scroll_on_disp)
+ term->disptop = 0;
break;
case 1048: /* save/restore cursor */
if (!term->no_alt_screen)
break;
case 1048: /* save/restore cursor */
if (!term->no_alt_screen)
swap_screen(term, term->no_alt_screen ? 0 : state, TRUE, FALSE);
if (!state && !term->no_alt_screen)
save_cursor(term, state);
swap_screen(term, term->no_alt_screen ? 0 : state, TRUE, FALSE);
if (!state && !term->no_alt_screen)
save_cursor(term, state);
+ if (term->scroll_on_disp)
+ term->disptop = 0;
break;
case 2004: /* xterm bracketed paste */
term->bracketed_paste = state ? TRUE : FALSE;
break;
case 2004: /* xterm bracketed paste */
term->bracketed_paste = state ? TRUE : FALSE;
if (has_compat(SCOANSI)) {
move(term, 0, 0, 0);
erase_lots(term, FALSE, FALSE, TRUE);
if (has_compat(SCOANSI)) {
move(term, 0, 0, 0);
erase_lots(term, FALSE, FALSE, TRUE);
+ if (term->scroll_on_disp)
+ term->disptop = 0;
term->wrapnext = FALSE;
seen_disp_event(term);
break;
term->wrapnext = FALSE;
seen_disp_event(term);
break;
request_resize(term->frontend, 80, term->rows);
term->reset_132 = 0;
}
request_resize(term->frontend, 80, term->rows);
term->reset_132 = 0;
}
+ if (term->scroll_on_disp)
+ term->disptop = 0;
seen_disp_event(term);
break;
case 'H': /* HTS: set a tab */
seen_disp_event(term);
break;
case 'H': /* HTS: set a tab */
}
ldata->lattr = LATTR_NORM;
}
}
ldata->lattr = LATTR_NORM;
}
+ if (term->scroll_on_disp)
+ term->disptop = 0;
seen_disp_event(term);
scrtop.x = scrtop.y = 0;
scrbot.x = 0;
seen_disp_event(term);
scrtop.x = scrtop.y = 0;
scrbot.x = 0;
erase_lots(term, FALSE, !!(i & 2), !!(i & 1));
}
}
erase_lots(term, FALSE, !!(i & 2), !!(i & 1));
}
}
+ if (term->scroll_on_disp)
+ term->disptop = 0;
seen_disp_event(term);
break;
case 'K': /* EL: erase line or parts of it */
seen_disp_event(term);
break;
case 'K': /* EL: erase line or parts of it */
break;
case 'J':
erase_lots(term, FALSE, FALSE, TRUE);
break;
case 'J':
erase_lots(term, FALSE, FALSE, TRUE);
+ if (term->scroll_on_disp)
+ term->disptop = 0;
break;
case 'K':
erase_lots(term, TRUE, FALSE, TRUE);
break;
case 'K':
erase_lots(term, TRUE, FALSE, TRUE);
/* compatibility(ATARI) */
move(term, 0, 0, 0);
erase_lots(term, FALSE, FALSE, TRUE);
/* compatibility(ATARI) */
move(term, 0, 0, 0);
erase_lots(term, FALSE, FALSE, TRUE);
+ if (term->scroll_on_disp)
+ term->disptop = 0;
break;
case 'L':
/* compatibility(ATARI) */
break;
case 'L':
/* compatibility(ATARI) */
case 'd':
/* compatibility(ATARI) */
erase_lots(term, FALSE, TRUE, FALSE);
case 'd':
/* compatibility(ATARI) */
erase_lots(term, FALSE, TRUE, FALSE);
+ if (term->scroll_on_disp)
+ term->disptop = 0;
break;
case 'e':
/* compatibility(ATARI) */
break;
case 'e':
/* compatibility(ATARI) */