summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-attach-session.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2020-04-13 10:59:58 +0000
committernicm <nicm@openbsd.org>2020-04-13 10:59:58 +0000
commit040343ae18e7aa6a49c6acf6e4add8a0b76f6fff (patch)
tree8ed8ccb63639c656437cc1539d3d2b96b405d399 /usr.bin/tmux/cmd-attach-session.c
parentMake struct cmd local to cmd.c and move it out of tmux.h. (diff)
downloadwireguard-openbsd-040343ae18e7aa6a49c6acf6e4add8a0b76f6fff.tar.xz
wireguard-openbsd-040343ae18e7aa6a49c6acf6e4add8a0b76f6fff.zip
Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make its
use more clearly defined and preparation for some future work).
Diffstat (limited to 'usr.bin/tmux/cmd-attach-session.c')
-rw-r--r--usr.bin/tmux/cmd-attach-session.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c
index 0c1de1c8177..c31adab30cb 100644
--- a/usr.bin/tmux/cmd-attach-session.c
+++ b/usr.bin/tmux/cmd-attach-session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-attach-session.c,v 1.80 2020/04/13 08:26:27 nicm Exp $ */
+/* $OpenBSD: cmd-attach-session.c,v 1.81 2020/04/13 10:59:58 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -50,10 +50,12 @@ enum cmd_retval
cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag,
int xflag, int rflag, const char *cflag, int Eflag)
{
- struct cmd_find_state *current = &item->shared->current;
+ struct cmdq_shared *shared = cmdq_get_shared(item);
+ struct cmd_find_state *current = &shared->current;
+ struct cmd_find_state target;
enum cmd_find_type type;
int flags;
- struct client *c = item->client, *c_loop;
+ struct client *c = cmdq_get_client(item), *c_loop;
struct session *s;
struct winlink *wl;
struct window_pane *wp;
@@ -80,11 +82,11 @@ cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag,
type = CMD_FIND_SESSION;
flags = CMD_FIND_PREFER_UNATTACHED;
}
- if (cmd_find_target(&item->target, item, tflag, type, flags) != 0)
+ if (cmd_find_target(&target, item, tflag, type, flags) != 0)
return (CMD_RETURN_ERROR);
- s = item->target.s;
- wl = item->target.wl;
- wp = item->target.wp;
+ s = target.s;
+ wl = target.wl;
+ wp = target.wp;
if (wl != NULL) {
if (wp != NULL)
@@ -118,7 +120,7 @@ cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag,
environ_update(s->options, c->environ, s->environ);
c->session = s;
- if (~item->shared->flags & CMDQ_SHARED_REPEAT)
+ if (~shared->flags & CMDQ_SHARED_REPEAT)
server_client_set_key_table(c, NULL);
tty_update_client_offset(c);
status_timer_start(c);