Skip to content

Commit

Permalink
maintain scrollback buffer in left/right margin mode with default mar…
Browse files Browse the repository at this point in the history
…gins (#916);

do not put cleared lines into scrollback buffer
  • Loading branch information
mintty committed Sep 23, 2019
1 parent e6a78ee commit 37447a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ term_do_scroll(int topline, int botline, int lines, bool sb)
win_update(true);
}

if (term.lrmargmode) {
if (term.lrmargmode && term.marg_left && term.marg_right != term.cols - 1) {
scroll_rect(topline, botline, lines);
return;
}
Expand Down Expand Up @@ -1313,6 +1313,8 @@ term_erase(bool selective, bool line_only, bool from_begin, bool to_end)
if (!from_begin || !to_end)
term_check_boundary(curs->x, curs->y);

#ifdef scrollback_erase_lines
#warning this behaviour is not compatible with xterm
/* Lines scrolled away shouldn't be brought back on if the terminal resizes. */
bool erasing_lines_from_top =
start.y == 0 && start.x == 0 && end.x == 0 && !line_only && !selective;
Expand All @@ -1335,7 +1337,9 @@ term_erase(bool selective, bool line_only, bool from_begin, bool to_end)
if (!term.on_alt_screen)
term.tempsblines = 0;
}
else {
else
#endif
{
termline *line = term.lines[start.y];
while (poslt(start, end)) {
int cols = min(line->cols, line->size);
Expand Down
2 changes: 2 additions & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Terminal features
* Maintain scrollback buffer in left/right margin mode with default margins (#916).
* Do not put cleared lines into scrollback buffer.
* Fixed display of subsequent identical emojis (since 3.0.1).
* Mouse buttons 4 and 5 send the same escape sequences as xterm.
* DECAUPSS to assign user-preferred supplemental sets to DECSUPP.
Expand Down

0 comments on commit 37447a9

Please sign in to comment.