Like xterm, ignore DL and EL outside the scroll region, GitHub issue 5754.

This commit is contained in:
nicm
2026-10-16 11:33:44 +00:00
committed by tmux update bot
parent 6eb906dbd5
commit 5965228c1f

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: screen-write.c,v 1.302 2026/10/16 07:59:06 nicm Exp $ */
/* $OpenBSD: screen-write.c,v 1.303 2026/10/16 11:33:44 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1613,36 +1613,13 @@ screen_write_insertline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
struct screen *s = ctx->s;
struct grid *gd = s->grid;
struct tty_ctx ttyctx;
u_int sy = screen_size_y(s);
if (ny == 0)
ny = 1;
if (s->cy < s->rupper || s->cy > s->rlower) {
if (ny > sy - s->cy)
ny = sy - s->cy;
if (ny == 0)
if (s->cy < s->rupper || s->cy > s->rlower)
return;
screen_write_initctx(ctx, &ttyctx, 1, 1);
ttyctx.bg = bg;
grid_view_insert_lines(gd, s->cy, ny, bg);
screen_write_collect_flush(ctx, 0, __func__);
ttyctx.n = ny;
if (!screen_write_should_draw_lines(ctx, s->cy, sy - s->cy))
return;
if (~ttyctx.flags & TTY_CTX_PANE_OBSCURED || ctx->wp == NULL) {
tty_write(tty_cmd_insertline, &ttyctx);
return;
}
screen_write_redraw_pane(ctx, &ttyctx);
return;
}
if (ny > s->rlower + 1 - s->cy)
ny = s->rlower + 1 - s->cy;
if (ny == 0)
@@ -1651,9 +1628,6 @@ screen_write_insertline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
screen_write_initctx(ctx, &ttyctx, 1, 1);
ttyctx.bg = bg;
if (s->cy < s->rupper || s->cy > s->rlower)
grid_view_insert_lines(gd, s->cy, ny, bg);
else
grid_view_insert_lines_region(gd, s->rlower, s->cy, ny, bg);
screen_write_collect_flush(ctx, 0, __func__);
@@ -1676,37 +1650,14 @@ screen_write_deleteline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
struct screen *s = ctx->s;
struct grid *gd = s->grid;
struct tty_ctx ttyctx;
u_int sy = screen_size_y(s), ry;
u_int ry;
if (ny == 0)
ny = 1;
if (s->cy < s->rupper || s->cy > s->rlower) {
if (ny > sy - s->cy)
ny = sy - s->cy;
if (ny == 0)
if (s->cy < s->rupper || s->cy > s->rlower)
return;
screen_write_initctx(ctx, &ttyctx, 1, 1);
ttyctx.bg = bg;
grid_view_delete_lines(gd, s->cy, ny, bg);
screen_write_collect_flush(ctx, 0, __func__);
ttyctx.n = ny;
ry = s->rlower + 1 - s->rupper;
if (!screen_write_should_draw_lines(ctx, s->rupper, ry))
return;
if (~ttyctx.flags & TTY_CTX_PANE_OBSCURED || ctx->wp == NULL) {
tty_write(tty_cmd_deleteline, &ttyctx);
return;
}
screen_write_redraw_pane(ctx, &ttyctx);
return;
}
ry = s->rlower + 1 - s->cy;
if (ny > ry)
ny = ry;
@@ -1716,9 +1667,6 @@ screen_write_deleteline(struct screen_write_ctx *ctx, u_int ny, u_int bg)
screen_write_initctx(ctx, &ttyctx, 1, 1);
ttyctx.bg = bg;
if (s->cy < s->rupper || s->cy > s->rlower)
grid_view_delete_lines(gd, s->cy, ny, bg);
else
grid_view_delete_lines_region(gd, s->rlower, s->cy, ny, bg);
screen_write_collect_flush(ctx, 0, __func__);