=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-new-window.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- src/usr.bin/tmux/cmd-new-window.c 2013/03/24 09:27:20 1.30 +++ src/usr.bin/tmux/cmd-new-window.c 2013/03/24 09:54:10 1.31 @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-window.c,v 1.30 2013/03/24 09:27:20 nicm Exp $ */ +/* $OpenBSD: cmd-new-window.c,v 1.31 2013/03/24 09:54:10 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -26,7 +26,7 @@ * Create a new window. */ -enum cmd_retval cmd_new_window_exec(struct cmd *, struct cmd_ctx *); +enum cmd_retval cmd_new_window_exec(struct cmd *, struct cmd_q *); const struct cmd_entry cmd_new_window_entry = { "new-window", "neww", @@ -40,7 +40,7 @@ }; enum cmd_retval -cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) +cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; struct session *s; @@ -54,7 +54,7 @@ char *cp; if (args_has(args, 'a')) { - wl = cmd_find_window(ctx, args_get(args, 't'), &s); + wl = cmd_find_window(cmdq, args_get(args, 't'), &s); if (wl == NULL) return (CMD_RETURN_ERROR); idx = wl->idx + 1; @@ -65,7 +65,7 @@ break; } if (last == INT_MAX) { - ctx->error(ctx, "no free window indexes"); + cmdq_error(cmdq, "no free window indexes"); return (CMD_RETURN_ERROR); } @@ -76,7 +76,7 @@ server_unlink_window(s, wl); } } else { - if ((idx = cmd_find_index(ctx, args_get(args, 't'), &s)) == -2) + if ((idx = cmd_find_index(cmdq, args_get(args, 't'), &s)) == -2) return (CMD_RETURN_ERROR); } detached = args_has(args, 'd'); @@ -105,13 +105,13 @@ cmd = options_get_string(&s->options, "default-command"); else cmd = args->argv[0]; - cwd = cmd_get_default_path(ctx, args_get(args, 'c')); + cwd = cmd_get_default_path(cmdq, args_get(args, 'c')); if (idx == -1) idx = -1 - options_get_number(&s->options, "base-index"); wl = session_new(s, args_get(args, 'n'), cmd, cwd, idx, &cause); if (wl == NULL) { - ctx->error(ctx, "create window failed: %s", cause); + cmdq_error(cmdq, "create window failed: %s", cause); free(cause); return (CMD_RETURN_ERROR); } @@ -126,14 +126,14 @@ template = NEW_WINDOW_TEMPLATE; ft = format_create(); - if ((c = cmd_find_client(ctx, NULL, 1)) != NULL) - format_client(ft, c); + if ((c = cmd_find_client(cmdq, NULL, 1)) != NULL) + format_client(ft, c); format_session(ft, s); format_winlink(ft, s, wl); format_window_pane(ft, wl->window->active); cp = format_expand(ft, template); - ctx->print(ctx, "%s", cp); + cmdq_print(cmdq, "%s", cp); free(cp); format_free(ft);