diff --git a/cmd-refresh-client.c b/cmd-refresh-client.c index c53a6a78..d31bd2cc 100644 --- a/cmd-refresh-client.c +++ b/cmd-refresh-client.c @@ -113,26 +113,24 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item) server_client_set_flags(tc, args_get(args, 'f')); if (args_has(args, 'C')) { - if (args_has(args, 'C')) { - if (!(tc->flags & CLIENT_CONTROL)) { - cmdq_error(item, "not a control client"); - return (CMD_RETURN_ERROR); - } - size = args_get(args, 'C'); - if (sscanf(size, "%u,%u", &x, &y) != 2 && - sscanf(size, "%ux%u", &x, &y) != 2) { - cmdq_error(item, "bad size argument"); - return (CMD_RETURN_ERROR); - } - if (x < WINDOW_MINIMUM || x > WINDOW_MAXIMUM || - y < WINDOW_MINIMUM || y > WINDOW_MAXIMUM) { - cmdq_error(item, "size too small or too big"); - return (CMD_RETURN_ERROR); - } - tty_set_size(&tc->tty, x, y, 0, 0); - tc->flags |= CLIENT_SIZECHANGED; - recalculate_sizes(); + if (~tc->flags & CLIENT_CONTROL) { + cmdq_error(item, "not a control client"); + return (CMD_RETURN_ERROR); } + size = args_get(args, 'C'); + if (sscanf(size, "%u,%u", &x, &y) != 2 && + sscanf(size, "%ux%u", &x, &y) != 2) { + cmdq_error(item, "bad size argument"); + return (CMD_RETURN_ERROR); + } + if (x < WINDOW_MINIMUM || x > WINDOW_MAXIMUM || + y < WINDOW_MINIMUM || y > WINDOW_MAXIMUM) { + cmdq_error(item, "size too small or too big"); + return (CMD_RETURN_ERROR); + } + tty_set_size(&tc->tty, x, y, 0, 0); + tc->flags |= CLIENT_SIZECHANGED; + recalculate_sizes(); return (CMD_RETURN_NORMAL); } diff --git a/key-string.c b/key-string.c index 65f1afe5..79f80554 100644 --- a/key-string.c +++ b/key-string.c @@ -62,28 +62,28 @@ static const struct { { "Escape", '\033' }, /* Arrow keys. */ - { "Up", KEYC_UP }, - { "Down", KEYC_DOWN }, - { "Left", KEYC_LEFT }, - { "Right", KEYC_RIGHT }, + { "Up", KEYC_UP|KEYC_CURSOR }, + { "Down", KEYC_DOWN|KEYC_CURSOR }, + { "Left", KEYC_LEFT|KEYC_CURSOR }, + { "Right", KEYC_RIGHT|KEYC_CURSOR }, /* Numeric keypad. */ - { "KP/", KEYC_KP_SLASH }, - { "KP*", KEYC_KP_STAR }, - { "KP-", KEYC_KP_MINUS }, - { "KP7", KEYC_KP_SEVEN }, - { "KP8", KEYC_KP_EIGHT }, - { "KP9", KEYC_KP_NINE }, - { "KP+", KEYC_KP_PLUS }, - { "KP4", KEYC_KP_FOUR }, - { "KP5", KEYC_KP_FIVE }, - { "KP6", KEYC_KP_SIX }, - { "KP1", KEYC_KP_ONE }, - { "KP2", KEYC_KP_TWO }, - { "KP3", KEYC_KP_THREE }, - { "KPEnter", KEYC_KP_ENTER }, - { "KP0", KEYC_KP_ZERO }, - { "KP.", KEYC_KP_PERIOD }, + { "KP/", KEYC_KP_SLASH|KEYC_KEYPAD }, + { "KP*", KEYC_KP_STAR|KEYC_KEYPAD }, + { "KP-", KEYC_KP_MINUS|KEYC_KEYPAD }, + { "KP7", KEYC_KP_SEVEN|KEYC_KEYPAD }, + { "KP8", KEYC_KP_EIGHT|KEYC_KEYPAD }, + { "KP9", KEYC_KP_NINE|KEYC_KEYPAD }, + { "KP+", KEYC_KP_PLUS|KEYC_KEYPAD }, + { "KP4", KEYC_KP_FOUR|KEYC_KEYPAD }, + { "KP5", KEYC_KP_FIVE|KEYC_KEYPAD }, + { "KP6", KEYC_KP_SIX|KEYC_KEYPAD }, + { "KP1", KEYC_KP_ONE|KEYC_KEYPAD }, + { "KP2", KEYC_KP_TWO|KEYC_KEYPAD }, + { "KP3", KEYC_KP_THREE|KEYC_KEYPAD }, + { "KPEnter", KEYC_KP_ENTER|KEYC_KEYPAD }, + { "KP0", KEYC_KP_ZERO|KEYC_KEYPAD }, + { "KP.", KEYC_KP_PERIOD|KEYC_KEYPAD }, /* Mouse keys. */ KEYC_MOUSE_STRING(MOUSEDOWN1, MouseDown1),