Created
May 15, 2015 20:16
-
-
Save landaire/b4505e826e54e82da55c to your computer and use it in GitHub Desktop.
tmux 1.9a -> 2.0 server_client_set_title diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tmux.old b/tmux.new | |
index eae8bba..b52efd7 100644 | |
--- a/tmux.old | |
+++ b/tmux.new | |
@@ -1,17 +1,23 @@ | |
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, NULL, 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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment