-/* $OpenBSD: format.c,v 1.299 2021/10/25 21:21:16 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.300 2022/02/22 11:10:41 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
return (NULL);
}
+/* Callback for next_session_id. */
+static void *
+format_cb_next_session_id(__unused struct format_tree *ft)
+{
+ return (format_printf("$%u", next_session_id));
+}
+
/* Callback for origin_flag. */
static void *
format_cb_origin_flag(struct format_tree *ft)
{ "mouse_y", FORMAT_TABLE_STRING,
format_cb_mouse_y
},
+ { "next_session_id", FORMAT_TABLE_STRING,
+ format_cb_next_session_id
+ },
{ "origin_flag", FORMAT_TABLE_STRING,
format_cb_origin_flag
},
-/* $OpenBSD: session.c,v 1.90 2021/09/17 07:20:49 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.91 2022/02/22 11:10:41 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
#include "tmux.h"
struct sessions sessions;
-static u_int next_session_id;
+u_int next_session_id;
struct session_groups session_groups = RB_INITIALIZER(&session_groups);
static void session_free(int, short, void *);
-.\" $OpenBSD: tmux.1,v 1.878 2022/02/22 10:53:34 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.879 2022/02/22 11:10:41 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
.It Li "mouse_word" Ta "" Ta "Word under mouse, if any"
.It Li "mouse_x" Ta "" Ta "Mouse X position, if any"
.It Li "mouse_y" Ta "" Ta "Mouse Y position, if any"
+.It Li "next_session_id" Ta "" Ta "Unique session ID for next new session"
.It Li "origin_flag" Ta "" Ta "Pane origin flag"
.It Li "pane_active" Ta "" Ta "1 if active pane"
.It Li "pane_at_bottom" Ta "" Ta "1 if pane is at the bottom of window"
-/* $OpenBSD: tmux.h,v 1.1160 2022/02/16 18:55:05 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1161 2022/02/22 11:10:41 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
/* session.c */
extern struct sessions sessions;
+extern u_int next_session_id;
int session_cmp(struct session *, struct session *);
RB_PROTOTYPE(sessions, session, entry, session_cmp);
int session_alive(struct session *);