version 1.22, 2014/10/20 22:29:25 |
version 1.23, 2015/04/20 15:34:56 |
|
|
|
|
const struct cmd_entry cmd_switch_client_entry = { |
const struct cmd_entry cmd_switch_client_entry = { |
"switch-client", "switchc", |
"switch-client", "switchc", |
"lc:npt:r", 0, 0, |
"lc:npt:rT:", 0, 0, |
"[-lnpr] [-c target-client] [-t target-session]", |
"[-lnpr] [-c target-client] [-t target-session] [-T key-table]", |
CMD_READONLY, |
CMD_READONLY, |
cmd_switch_client_exec |
cmd_switch_client_exec |
}; |
}; |
|
|
struct winlink *wl = NULL; |
struct winlink *wl = NULL; |
struct window *w = NULL; |
struct window *w = NULL; |
struct window_pane *wp = NULL; |
struct window_pane *wp = NULL; |
const char *tflag; |
const char *tflag, *tablename; |
|
struct key_table *table; |
|
|
if ((c = cmd_find_client(cmdq, args_get(args, 'c'), 0)) == NULL) |
if ((c = cmd_find_client(cmdq, args_get(args, 'c'), 0)) == NULL) |
return (CMD_RETURN_ERROR); |
return (CMD_RETURN_ERROR); |
|
|
c->flags &= ~CLIENT_READONLY; |
c->flags &= ~CLIENT_READONLY; |
else |
else |
c->flags |= CLIENT_READONLY; |
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'); |
tflag = args_get(args, 't'); |