mirror of
https://github.com/tmux/tmux.git
synced 2024-11-18 10:28:54 +00:00
Use formats not status_replace for set-titles-string.
This commit is contained in:
parent
03758a50dc
commit
8d94bb67ab
@ -773,19 +773,25 @@ server_client_check_redraw(struct client *c)
|
|||||||
void
|
void
|
||||||
server_client_set_title(struct client *c)
|
server_client_set_title(struct client *c)
|
||||||
{
|
{
|
||||||
struct session *s = c->session;
|
struct session *s = c->session;
|
||||||
const char *template;
|
const char *template;
|
||||||
char *title;
|
char *title;
|
||||||
|
struct format_tree *ft;
|
||||||
|
|
||||||
template = options_get_string(&s->options, "set-titles-string");
|
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) {
|
if (c->title == NULL || strcmp(title, c->title) != 0) {
|
||||||
free(c->title);
|
free(c->title);
|
||||||
c->title = xstrdup(title);
|
c->title = xstrdup(title);
|
||||||
tty_set_title(&c->tty, c->title);
|
tty_set_title(&c->tty, c->title);
|
||||||
}
|
}
|
||||||
free(title);
|
free(title);
|
||||||
|
|
||||||
|
format_free(ft);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dispatch message from client. */
|
/* Dispatch message from client. */
|
||||||
|
Loading…
Reference in New Issue
Block a user