Skip to content

Instantly share code, notes, and snippets.

@landaire
Created May 15, 2015 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save landaire/b4505e826e54e82da55c to your computer and use it in GitHub Desktop.
Save landaire/b4505e826e54e82da55c to your computer and use it in GitHub Desktop.
tmux 1.9a -> 2.0 server_client_set_title diff
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