summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/session.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-05-06 08:35:39 +0000
committernicm <nicm@openbsd.org>2015-05-06 08:35:39 +0000
commitc8f8381c99a5e3696504791d96fe5ea2f074476d (patch)
treeea5afe207689771802282c502e6e6756fa133aac /usr.bin/tmux/session.c
parentDocument that priority 1 is reserved for kernel use. (diff)
downloadwireguard-openbsd-c8f8381c99a5e3696504791d96fe5ea2f074476d.tar.xz
wireguard-openbsd-c8f8381c99a5e3696504791d96fe5ea2f074476d.zip
Add a format window_linked which is 1 if a window has been linked
multiple times, also remove the default space in window_flags and use a conditional to add it in window-status-format (this means additional flags can be added in the option without extra spaces). From Thomas Adam with tweaks by me.
Diffstat (limited to 'usr.bin/tmux/session.c')
-rw-r--r--usr.bin/tmux/session.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c
index f809f06bbf8..39d2d1a1fe7 100644
--- a/usr.bin/tmux/session.c
+++ b/usr.bin/tmux/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.48 2015/04/25 18:09:28 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.49 2015/05/06 08:35:39 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -337,6 +337,20 @@ session_has(struct session *s, struct window *w)
return (0);
}
+/*
+ * Return 1 if a window is linked outside this session (not including session
+ * groups). The window must be in this session!
+ */
+int
+session_is_linked(struct session *s, struct window *w)
+{
+ struct session_group *sg;
+
+ if ((sg = session_group_find(s)) != NULL)
+ return (w->references != session_group_count(sg));
+ return (w->references != 1);
+}
+
struct winlink *
session_next_alert(struct winlink *wl)
{