From 6cbf4cc07c02fba46e7fbae921ef50d04ddb6836 Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 7 Jun 2026 20:05:16 +0000 Subject: [PATCH] Move checking of whether the cursor is visible inside the if so that it always hits the calculation of the oy offset when the status line is at the top. From Michael Grant. --- usr.bin/tmux/server-client.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 9c5d807258b..607d0ee42cf 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.461 2026/06/02 08:13:50 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.462 2026/06/07 20:05:16 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -1819,12 +1819,13 @@ server_client_reset_state(struct client *c) cx = wp->xoff + (int)s->cx - (int)ox; cy = wp->yoff + (int)s->cy - (int)oy; + r = screen_redraw_get_visible_ranges(wp, cx, cy, 1, NULL); + if (!screen_redraw_is_visible(r, cx)) + cursor = 0; + if (status_at_line(c) == 0) cy += status_line_size(c); } - r = screen_redraw_get_visible_ranges(wp, cx, cy, 1, NULL); - if (!screen_redraw_is_visible(r, cx)) - cursor = 0; if (!cursor) mode &= ~MODE_CURSOR;