diff options
author | nicm <nicm> | 2015-02-06 17:17:12 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-02-06 17:17:12 +0000 |
commit | 8d94bb67abe0e83571bc5c0875755a40ea9c9039 (patch) | |
tree | 29d14dcd302b31dd140e22843b6537821291c6d1 | |
parent | 03758a50dc21b7c77b75f689d06f81292266c20a (diff) | |
download | rtmux-8d94bb67abe0e83571bc5c0875755a40ea9c9039.tar.gz rtmux-8d94bb67abe0e83571bc5c0875755a40ea9c9039.tar.bz2 rtmux-8d94bb67abe0e83571bc5c0875755a40ea9c9039.zip |
Use formats not status_replace for set-titles-string.
-rw-r--r-- | server-client.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/server-client.c b/server-client.c index 6c475f2d..280815cb 100644 --- a/server-client.c +++ b/server-client.c @@ -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. */ |