=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-break-pane.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/usr.bin/tmux/cmd-break-pane.c 2012/02/02 00:10:11 1.12 +++ src/usr.bin/tmux/cmd-break-pane.c 2012/03/12 13:31:09 1.13 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-break-pane.c,v 1.12 2012/02/02 00:10:11 nicm Exp $ */ +/* $OpenBSD: cmd-break-pane.c,v 1.13 2012/03/12 13:31:09 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -30,8 +30,8 @@ const struct cmd_entry cmd_break_pane_entry = { "break-pane", "breakp", - "dt:", 0, 0, - "[-d] " CMD_TARGET_PANE_USAGE, + "dPF:t:", 0, 0, + "[-dP] [-F format] " CMD_TARGET_PANE_USAGE, 0, NULL, NULL, @@ -49,6 +49,10 @@ char *name; char *cause; int base_idx; + struct client *c; + struct format_tree *ft; + const char *template; + char *cp; if ((wl = cmd_find_pane(ctx, args_get(args, 't'), &s, &wp)) == NULL) return (-1); @@ -88,5 +92,22 @@ server_redraw_session(s); server_status_session_group(s); + if (args_has(args, 'P')) { + template = "#{session_name}:#{window_index}"; + if (args_has(args, 'F')) + template = args_get(args, 'F'); + ft = format_create(); + if ((c = cmd_find_client(ctx, NULL)) != NULL) + format_client(ft, c); + format_session(ft, s); + format_winlink(ft, s, wl); + format_window_pane(ft, wp); + + cp = format_expand(ft, template); + ctx->print(ctx, "%s", cp); + xfree(cp); + + format_free(ft); + } return (0); }