diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2023-07-19 13:03:37 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2023-07-19 13:03:37 +0000 |
commit | c9496539bfdd21acc93aa1a4964be238c313b801 (patch) | |
tree | f2ff0616319dd9bb423c615a251b713598f144c9 | |
parent | 0e568c9fac458103eb88bc2d59d0c69a244dc094 (diff) |
Correct visited flag when the last window list is rebuilt by renumbering
windows, appears to fix hang reported by Mark Kelly.
-rw-r--r-- | usr.bin/tmux/session.c | 7 |
1 files 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 <nicholas.marriott@gmail.com> @@ -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. */ |