summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-04-22 20:47:00 +0000
committernicm <nicm@openbsd.org>2020-04-22 20:47:00 +0000
commit1d42e088881a88d4781e01982d3419509fc32e4b (patch)
treeb1965dfa6d549ec97f9a1a01ed3d72595d41bc46
parentsync (diff)
downloadwireguard-openbsd-1d42e088881a88d4781e01982d3419509fc32e4b.tar.xz
wireguard-openbsd-1d42e088881a88d4781e01982d3419509fc32e4b.zip
Add a session_marked format like window_marked.
-rw-r--r--usr.bin/tmux/format.c7
-rw-r--r--usr.bin/tmux/tmux.13
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index e39f7ef58bd..319e69e7712 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.246 2020/04/20 13:25:36 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.247 2020/04/22 20:47:00 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2529,6 +2529,11 @@ format_defaults_session(struct format_tree *ft, struct session *s)
format_add_cb(ft, "session_alerts", format_cb_session_alerts);
format_add_cb(ft, "session_stack", format_cb_session_stack);
+
+ if (server_check_marked() && marked_pane.s == s)
+ format_add(ft, "session_marked", "1");
+ else
+ format_add(ft, "session_marked", "0");
}
/* Set default format keys for a client. */
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 3a9db7dd716..0bab4269c42 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.747 2020/04/22 06:57:13 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.748 2020/04/22 20:47:00 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
@@ -4564,6 +4564,7 @@ The following variables are available, where appropriate:
.It Li "session_id" Ta "" Ta "Unique session ID"
.It Li "session_last_attached" Ta "" Ta "Time session last attached"
.It Li "session_many_attached" Ta "" Ta "1 if multiple clients attached"
+.It Li "session_marked" Ta "" Ta "1 if this session contains the marked pane"
.It Li "session_name" Ta "#S" Ta "Name of session"
.It Li "session_path" Ta "" Ta "Working directory of session"
.It Li "session_stack" Ta "" Ta "Window indexes in most recent order"