version 1.87, 2020/04/13 20:51:57 |
version 1.88, 2020/06/13 09:05:53 |
|
|
.name = "new-window", |
.name = "new-window", |
.alias = "neww", |
.alias = "neww", |
|
|
.args = { "ac:de:F:kn:Pt:", 0, -1 }, |
.args = { "abc:de:F:kn:Pt:", 0, -1 }, |
.usage = "[-adkP] [-c start-directory] [-e environment] [-F format] " |
.usage = "[-abdkP] [-c start-directory] [-e environment] [-F format] " |
"[-n window-name] " CMD_TARGET_WINDOW_USAGE " [command]", |
"[-n window-name] " CMD_TARGET_WINDOW_USAGE " [command]", |
|
|
.target = { 't', CMD_FIND_WINDOW, CMD_FIND_WINDOW_INDEX }, |
.target = { 't', CMD_FIND_WINDOW, CMD_FIND_WINDOW_INDEX }, |
|
|
struct client *tc = cmdq_get_target_client(item); |
struct client *tc = cmdq_get_target_client(item); |
struct session *s = target->s; |
struct session *s = target->s; |
struct winlink *wl = target->wl; |
struct winlink *wl = target->wl; |
int idx = target->idx; |
int idx = target->idx, before; |
struct winlink *new_wl; |
struct winlink *new_wl; |
char *cause = NULL, *cp; |
char *cause = NULL, *cp; |
const char *template, *add; |
const char *template, *add; |
struct cmd_find_state fs; |
struct cmd_find_state fs; |
struct args_value *value; |
struct args_value *value; |
|
|
if (args_has(args, 'a') && (idx = winlink_shuffle_up(s, wl)) == -1) { |
before = args_has(args, 'b'); |
cmdq_error(item, "couldn't get a window index"); |
if (args_has(args, 'a') || before) { |
return (CMD_RETURN_ERROR); |
idx = winlink_shuffle_up(s, wl, before); |
|
if (idx == -1) { |
|
cmdq_error(item, "couldn't get a window index"); |
|
return (CMD_RETURN_ERROR); |
|
} |
} |
} |
|
|
memset(&sc, 0, sizeof sc); |
memset(&sc, 0, sizeof sc); |