summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2016-10-15 00:12:59 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2016-10-15 00:12:59 +0000
commit5d1fbaecac17fd94e9a807fc5a4ad9ed4393f28f (patch)
tree5fad5c80625555dc64da72f659896b331a1dffac /usr.bin/tmux/session.c
parent35c63127e24018b37d1591d720f6100f18bb4919 (diff)
Rename a function for consistency and some spacing nits.
Diffstat (limited to 'usr.bin/tmux/session.c')
-rw-r--r--usr.bin/tmux/session.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c
index 1bd428bc45d..b7d4f50e8d4 100644
--- a/usr.bin/tmux/session.c
+++ b/usr.bin/tmux/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.65 2016/10/13 21:37:03 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.66 2016/10/15 00:12:58 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -211,6 +211,7 @@ session_destroy(struct session *s)
struct winlink *wl;
log_debug("session %s destroyed", s->name);
+ s->curw = NULL;
RB_REMOVE(sessions, &sessions, s);
notify_session_closed(s);
@@ -385,14 +386,17 @@ int
session_detach(struct session *s, struct winlink *wl)
{
if (s->curw == wl &&
- session_last(s) != 0 && session_previous(s, 0) != 0)
+ session_last(s) != 0 &&
+ session_previous(s, 0) != 0)
session_next(s, 0);
wl->flags &= ~WINLINK_ALERTFLAGS;
notify_window_unlinked(s, wl->window);
winlink_stack_remove(&s->lastw, wl);
winlink_remove(&s->windows, wl);
+
session_group_synchronize_from(s);
+
if (RB_EMPTY(&s->windows)) {
session_destroy(s);
return (1);