=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-switch-client.c,v retrieving revision 1.22 retrieving revision 1.23 diff -c -r1.22 -r1.23 *** src/usr.bin/tmux/cmd-switch-client.c 2014/10/20 22:29:25 1.22 --- src/usr.bin/tmux/cmd-switch-client.c 2015/04/20 15:34:56 1.23 *************** *** 1,4 **** ! /* $OpenBSD: cmd-switch-client.c,v 1.22 2014/10/20 22:29:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-switch-client.c,v 1.23 2015/04/20 15:34:56 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 31,38 **** const struct cmd_entry cmd_switch_client_entry = { "switch-client", "switchc", ! "lc:npt:r", 0, 0, ! "[-lnpr] [-c target-client] [-t target-session]", CMD_READONLY, cmd_switch_client_exec }; --- 31,38 ---- const struct cmd_entry cmd_switch_client_entry = { "switch-client", "switchc", ! "lc:npt:rT:", 0, 0, ! "[-lnpr] [-c target-client] [-t target-session] [-T key-table]", CMD_READONLY, cmd_switch_client_exec }; *************** *** 46,52 **** struct winlink *wl = NULL; struct window *w = NULL; struct window_pane *wp = NULL; ! const char *tflag; if ((c = cmd_find_client(cmdq, args_get(args, 'c'), 0)) == NULL) return (CMD_RETURN_ERROR); --- 46,53 ---- struct winlink *wl = NULL; struct window *w = NULL; struct window_pane *wp = NULL; ! const char *tflag, *tablename; ! struct key_table *table; if ((c = cmd_find_client(cmdq, args_get(args, 'c'), 0)) == NULL) return (CMD_RETURN_ERROR); *************** *** 56,61 **** --- 57,74 ---- c->flags &= ~CLIENT_READONLY; else c->flags |= CLIENT_READONLY; + } + + tablename = args_get(args, 'T'); + if (tablename != NULL) { + table = key_bindings_get_table(tablename, 0); + if (table == NULL) { + cmdq_error(cmdq, "table %s doesn't exist", tablename); + return (CMD_RETURN_ERROR); + } + table->references++; + key_bindings_unref_table(c->keytable); + c->keytable = table; } tflag = args_get(args, 't');