=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-split-window.c,v retrieving revision 1.20 retrieving revision 1.21 diff -c -r1.20 -r1.21 *** src/usr.bin/tmux/cmd-split-window.c 2010/06/27 02:56:59 1.20 --- src/usr.bin/tmux/cmd-split-window.c 2011/01/01 01:33:07 1.21 *************** *** 1,4 **** ! /* $OpenBSD: cmd-split-window.c,v 1.20 2010/06/27 02:56:59 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-split-window.c,v 1.21 2011/01/01 01:33:07 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 39,51 **** char *cmd; int flag_detached; int flag_horizontal; int percentage; int size; }; const struct cmd_entry cmd_split_window_entry = { "split-window", "splitw", ! "[-dhv] [-p percentage|-l size] [-t target-pane] [command]", 0, "", cmd_split_window_init, cmd_split_window_parse, --- 39,52 ---- char *cmd; int flag_detached; int flag_horizontal; + int flag_print; int percentage; int size; }; const struct cmd_entry cmd_split_window_entry = { "split-window", "splitw", ! "[-dhvP] [-p percentage|-l size] [-t target-pane] [command]", 0, "", cmd_split_window_init, cmd_split_window_parse, *************** *** 64,69 **** --- 65,71 ---- data->cmd = NULL; data->flag_detached = 0; data->flag_horizontal = 0; + data->flag_print = 0; data->percentage = -1; data->size = -1; *************** *** 87,93 **** self->entry->init(self, KEYC_NONE); data = self->data; ! while ((opt = getopt(argc, argv, "dhl:p:t:v")) != -1) { switch (opt) { case 'd': data->flag_detached = 1; --- 89,95 ---- self->entry->init(self, KEYC_NONE); data = self->data; ! while ((opt = getopt(argc, argv, "dhl:p:Pt:v")) != -1) { switch (opt) { case 'd': data->flag_detached = 1; *************** *** 117,122 **** --- 119,127 ---- goto error; } break; + case 'P': + data->flag_print = 1; + break; case 'v': data->flag_horizontal = 0; break; *************** *** 153,159 **** struct environ env; char *cmd, *cwd, *cause; const char *shell; ! u_int hlimit; int size; enum layout_type type; struct layout_cell *lc; --- 158,164 ---- struct environ env; char *cmd, *cwd, *cause; const char *shell; ! u_int hlimit, paneidx; int size; enum layout_type type; struct layout_cell *lc; *************** *** 217,222 **** --- 222,232 ---- server_status_session(s); environ_free(&env); + + if (data->flag_print) { + paneidx = window_pane_index(wl->window, new_wp); + ctx->print(ctx, "%s:%u.%u", s->name, wl->idx, paneidx); + } return (0); error: *************** *** 253,258 **** --- 263,270 ---- off += xsnprintf(buf + off, len - off, " -d"); if (off < len && data->flag_horizontal) off += xsnprintf(buf + off, len - off, " -h"); + if (off < len && data->flag_print) + off += xsnprintf(buf + off, len - off, " -P"); if (off < len && data->size > 0) off += xsnprintf(buf + off, len - off, " -l %d", data->size); if (off < len && data->percentage > 0) {