summaryrefslogtreecommitdiffstats
path: root/cmd-rename-window.c
diff options
context:
space:
mode:
authornicm <nicm>2018-03-01 12:53:08 +0000
committernicm <nicm>2018-03-01 12:53:08 +0000
commit182357f24bc7e16d7d7c85cab0c61974f18df2e7 (patch)
treeaaf97a0274f043e226f216c83f5dfd25db518e98 /cmd-rename-window.c
parent508e2f0b3aaf2db9b692863738e7ca75765fc70c (diff)
Expand formats in window and session names.
Diffstat (limited to 'cmd-rename-window.c')
-rw-r--r--cmd-rename-window.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd-rename-window.c b/cmd-rename-window.c
index 802eab7d..3393fb86 100644
--- a/cmd-rename-window.c
+++ b/cmd-rename-window.c
@@ -46,12 +46,17 @@ static enum cmd_retval
cmd_rename_window_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = self->args;
+ struct client *c = cmd_find_client(item, NULL, 0);
+ struct session *s = item->target.s;
struct winlink *wl = item->target.wl;
+ char *newname;
- window_set_name(wl->window, args->argv[0]);
+ newname = format_single(item, args->argv[0], c, s, wl, NULL);
+ window_set_name(wl->window, newname);
options_set_number(wl->window->options, "automatic-rename", 0);
server_status_window(wl->window);
+ free(newname);
return (CMD_RETURN_NORMAL);
}