diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-11-17 09:52:19 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-11-17 09:52:19 +0000 |
commit | bf5d97c2deb821966488047855f05a080bd869f4 (patch) | |
tree | 14bad3b88326001c281cd50688c6852e0f438dcd /usr.bin/tmux/cmd-select-pane.c | |
parent | d7d1988279293822be290e3f1ab4a3e9042a0a94 (diff) |
Allow formats in selectp -T, from Thomas Adam.
Diffstat (limited to 'usr.bin/tmux/cmd-select-pane.c')
-rw-r--r-- | usr.bin/tmux/cmd-select-pane.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c index f3039b1a0fd..76c7b5a7bf9 100644 --- a/usr.bin/tmux/cmd-select-pane.c +++ b/usr.bin/tmux/cmd-select-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-pane.c,v 1.41 2017/09/02 17:51:54 nicm Exp $ */ +/* $OpenBSD: cmd-select-pane.c,v 1.42 2017/11/17 09:52:18 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -18,6 +18,8 @@ #include <sys/types.h> +#include <stdlib.h> + #include "tmux.h" /* @@ -57,10 +59,12 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct cmd_find_state *current = &item->shared->current; + struct client *c = cmd_find_client(item, NULL, 1); struct winlink *wl = item->target.wl; struct window *w = wl->window; struct session *s = item->target.s; struct window_pane *wp = item->target.wp, *lastwp, *markedwp; + char *pane_title; const char *style; if (self->entry == &cmd_last_pane_entry || args_has(args, 'l')) { @@ -148,8 +152,11 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) } if (args_has(self->args, 'T')) { - screen_set_title(&wp->base, args_get(self->args, 'T')); - server_status_window(wp->window); + pane_title = format_single(item, args_get(self->args, 'T'), + c, s, wl, wp); + screen_set_title(&wp->base, pane_title); + server_status_window(wp->window); + free(pane_title); } if (wp == w->active) |