=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/control-notify.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- src/usr.bin/tmux/control-notify.c 2015/04/24 23:17:11 1.11 +++ src/usr.bin/tmux/control-notify.c 2015/11/13 10:00:26 1.12 @@ -1,4 +1,4 @@ -/* $OpenBSD: control-notify.c,v 1.11 2015/04/24 23:17:11 nicm Exp $ */ +/* $OpenBSD: control-notify.c,v 1.12 2015/11/13 10:00:26 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott @@ -19,6 +19,8 @@ #include +#include + #include "tmux.h" #define CONTROL_SHOULD_NOTIFY_CLIENT(c) \ @@ -65,7 +67,11 @@ struct format_tree *ft; struct winlink *wl; const char *template; + char *expanded; + template = "%layout-change #{window_id} #{window_layout} " + "#{window_visible_layout} #{window_flags}"; + TAILQ_FOREACH(c, &clients, entry) { if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) continue; @@ -81,13 +87,14 @@ */ if (w->layout_root == NULL) continue; - template = "%layout-change #{window_id} #{window_layout}"; ft = format_create(); wl = winlink_find_by_window(&s->windows, w); if (wl != NULL) { format_defaults(ft, c, NULL, wl, NULL); - control_write(c, "%s", format_expand(ft, template)); + expanded = format_expand(ft, template); + control_write(c, "%s", expanded); + free(expanded); } format_free(ft); }