mirror of
https://github.com/tmux/tmux.git
synced 2025-10-26 12:27:15 +00:00
Add support for the SD (scroll down) escape sequence, GitHub issue 1861.
This commit is contained in:
@@ -1088,6 +1088,31 @@ screen_write_scrollup(struct screen_write_ctx *ctx, u_int lines, u_int bg)
|
||||
ctx->scrolled += lines;
|
||||
}
|
||||
|
||||
/* Scroll down. */
|
||||
void
|
||||
screen_write_scrolldown(struct screen_write_ctx *ctx, u_int lines, u_int bg)
|
||||
{
|
||||
struct screen *s = ctx->s;
|
||||
struct grid *gd = s->grid;
|
||||
struct tty_ctx ttyctx;
|
||||
u_int i;
|
||||
|
||||
screen_write_initctx(ctx, &ttyctx);
|
||||
ttyctx.bg = bg;
|
||||
|
||||
if (lines == 0)
|
||||
lines = 1;
|
||||
else if (lines > s->rlower - s->rupper + 1)
|
||||
lines = s->rlower - s->rupper + 1;
|
||||
|
||||
for (i = 0; i < lines; i++)
|
||||
grid_view_scroll_region_down(gd, s->rupper, s->rlower, bg);
|
||||
|
||||
screen_write_collect_flush(ctx, 0);
|
||||
ttyctx.num = lines;
|
||||
tty_write(tty_cmd_scrolldown, &ttyctx);
|
||||
}
|
||||
|
||||
/* Carriage return (cursor to start of line). */
|
||||
void
|
||||
screen_write_carriagereturn(struct screen_write_ctx *ctx)
|
||||
|
||||
Reference in New Issue
Block a user