From bdc25a059e579f99e38eac5aef03a319006bd9db Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 19 Jul 2023 13:03:36 +0000 Subject: [PATCH] Correct visited flag when the last window list is rebuilt by renumbering windows, appears to fix hang reported by Mark Kelly. --- usr.bin/tmux/session.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c index ade3011772c..84bcbf4d170 100644 --- a/usr.bin/tmux/session.c +++ b/usr.bin/tmux/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.93 2022/10/17 10:59:42 nicm Exp $ */ +/* $OpenBSD: session.c,v 1.94 2023/07/19 13:03:36 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -739,9 +739,12 @@ session_renumber_windows(struct session *s) memcpy(&old_lastw, &s->lastw, sizeof old_lastw); TAILQ_INIT(&s->lastw); TAILQ_FOREACH(wl, &old_lastw, sentry) { + wl->flags &= ~WINLINK_VISITED; wl_new = winlink_find_by_window(&s->windows, wl->window); - if (wl_new != NULL) + if (wl_new != NULL) { TAILQ_INSERT_TAIL(&s->lastw, wl_new, sentry); + wl_new->flags |= WINLINK_VISITED; + } } /* Set the current window. */ -- 2.20.1