From 19b766077827885d91a9d3a6af253f179499f47e Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 22 Sep 2026 06:49:47 +0000 Subject: [PATCH] Only rely on the previous line wrapping when the cursor is actually on it, GitHub issue 5625 from Ben Maurer. --- tty-draw.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tty-draw.c b/tty-draw.c index cc190f821..d707d1bf3 100644 --- a/tty-draw.c +++ b/tty-draw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty-draw.c,v 1.16 2026/09/21 10:22:31 nicm Exp $ */ +/* $OpenBSD: tty-draw.c,v 1.17 2026/09/22 06:49:47 nicm Exp $ */ /* * Copyright (c) 2026 Nicholas Marriott @@ -218,7 +218,12 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx, } /* Did the previous line wrap on to this one? */ - if (py != 0 && atx == 0 && tty->cx >= tty->sx && nx == tty->sx) { + if (py != 0 && + atx == 0 && + tty->cx >= tty->sx && + tty->cy != UINT_MAX && + tty->cy + 1 == aty && + nx == tty->sx) { gl = grid_get_line(gd, gd->hsize + py - 1); if (gl->flags & GRID_LINE_WRAPPED) wrapped = 1;