aboutsummaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/session.c b/session.c
index 7d3fb32d..c4d553cb 100644
--- a/session.c
+++ b/session.c
@@ -35,6 +35,18 @@ struct session_groups session_groups;
struct winlink *session_next_alert(struct winlink *);
struct winlink *session_previous_alert(struct winlink *);
+/*
+ * Find if session is still alive. This is true if it is still on the global
+ * sessions list.
+ */
+int
+session_alive(struct session *s)
+{
+ u_int idx;
+
+ return (session_index(s, &idx) == 0);
+}
+
/* Find session by name. */
struct session *
session_find(const char *name)