summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-03-31 11:58:06 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-03-31 11:58:06 +0000
commit77ede6a238d6acb151c85cba70d220f0372d8086 (patch)
tree8392b82b4e012772860d557614c497a804eca4ff
parentfa38a79e0e37dba9f6fa1641b1694a614984c8d0 (diff)
Add session_path from Chris Ruegge in GitHub issue 2142.
-rw-r--r--usr.bin/tmux/format.c3
-rw-r--r--usr.bin/tmux/tmux.13
2 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c
index e5b01411955..bb2069293c7 100644
--- a/usr.bin/tmux/format.c
+++ b/usr.bin/tmux/format.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: format.c,v 1.231 2020/03/31 07:00:34 nicm Exp $ */
+/* $OpenBSD: format.c,v 1.232 2020/03/31 11:58:05 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -2477,6 +2477,7 @@ format_defaults_session(struct format_tree *ft, struct session *s)
ft->s = s;
format_add(ft, "session_name", "%s", s->name);
+ format_add(ft, "session_path", "%s", s->cwd);
format_add(ft, "session_windows", "%u", winlink_count(&s->windows));
format_add(ft, "session_id", "$%u", s->id);
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index a785cb5a316..78c839128b9 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.724 2020/03/31 11:38:35 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.725 2020/03/31 11:58:05 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
.\"
@@ -4422,6 +4422,7 @@ The following variables are available, where appropriate:
.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_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"
.It Li "session_windows" Ta "" Ta "Number of windows in session"
.It Li "socket_path" Ta "" Ta "Server socket path"