diff options
author | 2015-02-06 17:17:12 +0000 | |
---|---|---|
committer | 2015-02-06 17:17:12 +0000 | |
commit | 48d63a7aae9aeff989a79102e1694b49244c0595 (patch) | |
tree | c92a29268c4cd85f3b3da1bb042fe1ac05935d6c /usr.bin/tmux/server-client.c | |
parent | Add format_expand_time and use it instead of status_replace where (diff) | |
download | wireguard-openbsd-48d63a7aae9aeff989a79102e1694b49244c0595.tar.xz wireguard-openbsd-48d63a7aae9aeff989a79102e1694b49244c0595.zip |
Use formats not status_replace for set-titles-string.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index eea79773992..7171ac7aa4d 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.127 2015/02/01 23:43:23 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.128 2015/02/06 17:17:12 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -773,19 +773,25 @@ server_client_check_redraw(struct client *c) void server_client_set_title(struct client *c) { - struct session *s = c->session; - const char *template; - char *title; + struct session *s = c->session; + const char *template; + char *title; + struct format_tree *ft; template = options_get_string(&s->options, "set-titles-string"); - title = status_replace(c, NULL, template, time(NULL), 1); + ft = format_create(); + format_defaults(ft, c, NULL, NULL, NULL); + + title = format_expand_time(ft, template, time(NULL)); if (c->title == NULL || strcmp(title, c->title) != 0) { free(c->title); c->title = xstrdup(title); tty_set_title(&c->tty, c->title); } free(title); + + format_free(ft); } /* Dispatch message from client. */ |