mirror of
https://github.com/tmux/tmux.git
synced 2025-10-26 12:27:15 +00:00
Fix the logic of the no-detached case for detach-on-destroy option - a
previous change made it so that even in the no-detached case, tmux would always re-attach to a session, even if there weren't any detached ones. From Martin Louazel in GitHub issue 4649.
This commit is contained in:
@@ -401,7 +401,7 @@ server_find_session(struct session *s,
|
||||
struct session *s_loop, *s_out = NULL;
|
||||
|
||||
RB_FOREACH(s_loop, sessions, &sessions) {
|
||||
if (s_loop != s && (s_out == NULL || f(s_loop, s_out)))
|
||||
if (s_loop != s && f(s_loop, s_out))
|
||||
s_out = s_loop;
|
||||
}
|
||||
return (s_out);
|
||||
@@ -410,6 +410,8 @@ server_find_session(struct session *s,
|
||||
static int
|
||||
server_newer_session(struct session *s_loop, struct session *s_out)
|
||||
{
|
||||
if (s_out == NULL)
|
||||
return (1);
|
||||
return (timercmp(&s_loop->activity_time, &s_out->activity_time, >));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user