summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-rename-window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2018-03-01 12:53:08 +0000
committernicm <nicm@openbsd.org>2018-03-01 12:53:08 +0000
commit89b49179ccd80bf2f5ec3a2a3d3ff9965657ee93 (patch)
tree1a5b5b68ee72dcd9cf78ff7ff7508f4e6a394451 /usr.bin/tmux/cmd-rename-window.c
parentadd 6.4 firmware key (diff)
downloadwireguard-openbsd-89b49179ccd80bf2f5ec3a2a3d3ff9965657ee93.tar.xz
wireguard-openbsd-89b49179ccd80bf2f5ec3a2a3d3ff9965657ee93.zip
Expand formats in window and session names.
Diffstat (limited to 'usr.bin/tmux/cmd-rename-window.c')
-rw-r--r--usr.bin/tmux/cmd-rename-window.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-rename-window.c b/usr.bin/tmux/cmd-rename-window.c
index 52950012755..bc8d4af22c8 100644
--- a/usr.bin/tmux/cmd-rename-window.c
+++ b/usr.bin/tmux/cmd-rename-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-rename-window.c,v 1.20 2017/04/22 10:22:39 nicm Exp $ */
+/* $OpenBSD: cmd-rename-window.c,v 1.21 2018/03/01 12:53:08 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);
}