=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-resize-pane.c,v retrieving revision 1.12 retrieving revision 1.13 diff -c -r1.12 -r1.13 *** src/usr.bin/tmux/cmd-resize-pane.c 2013/01/17 00:11:22 1.12 --- src/usr.bin/tmux/cmd-resize-pane.c 2013/03/22 10:37:39 1.13 *************** *** 1,4 **** ! /* $OpenBSD: cmd-resize-pane.c,v 1.12 2013/01/17 00:11:22 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-resize-pane.c,v 1.13 2013/03/22 10:37:39 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 31,38 **** const struct cmd_entry cmd_resize_pane_entry = { "resize-pane", "resizep", ! "DLRt:U", 0, 1, ! "[-DLRU] " CMD_TARGET_PANE_USAGE " [adjustment]", 0, cmd_resize_pane_key_binding, NULL, --- 31,38 ---- const struct cmd_entry cmd_resize_pane_entry = { "resize-pane", "resizep", ! "DLRt:Ux:y:", 0, 1, ! "[-DLRU] [-x width] [-y height] " CMD_TARGET_PANE_USAGE " [adjustment]", 0, cmd_resize_pane_key_binding, NULL, *************** *** 87,94 **** --- 87,96 ---- struct args *args = self->args; struct winlink *wl; const char *errstr; + char *cause; struct window_pane *wp; u_int adjust; + int x, y; if ((wl = cmd_find_pane(ctx, args_get(args, 't'), NULL, &wp)) == NULL) return (CMD_RETURN_ERROR); *************** *** 101,106 **** --- 103,129 ---- ctx->error(ctx, "adjustment %s", errstr); return (CMD_RETURN_ERROR); } + } + + if (args_has(self->args, 'x')) { + x = args_strtonum(self->args, 'x', PANE_MINIMUM, INT_MAX, + &cause); + if (cause != NULL) { + ctx->error(ctx, "width %s", cause); + free(cause); + return (CMD_RETURN_ERROR); + } + layout_resize_pane_to(wp, LAYOUT_LEFTRIGHT, x); + } + if (args_has(self->args, 'y')) { + y = args_strtonum(self->args, 'y', PANE_MINIMUM, INT_MAX, + &cause); + if (cause != NULL) { + ctx->error(ctx, "height %s", cause); + free(cause); + return (CMD_RETURN_ERROR); + } + layout_resize_pane_to(wp, LAYOUT_TOPBOTTOM, y); } if (args_has(self->args, 'L'))