diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-22 10:32:37 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-03-22 10:32:37 +0000 |
commit | e223112e51a632f343e0df6d1c985e779a98f0a6 (patch) | |
tree | a1e93ad9d65049bd19f1e2fe0669ba9b6542aa5f /usr.bin | |
parent | 14cda468dba40c172683503f0768bc238dba7efd (diff) |
Add client_session and client_last_session formats.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/format.c | 14 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.1 | 6 |
2 files changed, 15 insertions, 5 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 9cd61124891..240af95ca9d 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.14 2013/03/21 16:14:09 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.15 2013/03/22 10:32:36 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net> @@ -301,8 +301,9 @@ format_session(struct format_tree *ft, struct session *s) void format_client(struct format_tree *ft, struct client *c) { - char *tim; - time_t t; + char *tim; + time_t t; + struct session *s; format_add(ft, "client_cwd", "%s", c->cwd); format_add(ft, "client_height", "%u", c->tty.sy); @@ -333,6 +334,13 @@ format_client(struct format_tree *ft, struct client *c) format_add(ft, "client_readonly", "%d", 1); else format_add(ft, "client_readonly", "%d", 0); + + s = c->session; + if (s != NULL) + format_add(ft, "client_session", "%s", s->name); + s = c->last_session; + if (s != NULL && session_alive(s)) + format_add(ft, "client_last_session", "%s", s->name); } /* Set default format keys for a winlink. */ diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 93d6cd8c551..1c9a49be123 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.322 2013/03/21 18:43:34 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.323 2013/03/22 10:32:36 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: March 21 2013 $ +.Dd $Mdocdate: March 22 2013 $ .Dt TMUX 1 .Os .Sh NAME @@ -2964,8 +2964,10 @@ The following variables are available, where appropriate: .It Li "client_created_string" Ta "String time client created" .It Li "client_cwd" Ta "Working directory of client" .It Li "client_height" Ta "Height of client" +.It Li "client_last_session" Ta "Name of the client's last session" .It Li "client_prefix" Ta "1 if prefix key has been pressed" .It Li "client_readonly" Ta "1 if client is readonly" +.It Li "client_session" Ta "Name of the client's session" .It Li "client_termname" Ta "Terminal name of client" .It Li "client_tty" Ta "Pseudo terminal of client" .It Li "client_utf8" Ta "1 if client supports utf8" |