diff options
author | Thomas Adam <thomas@xteddy.org> | 2017-05-28 22:01:11 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2017-05-28 22:01:11 +0100 |
commit | 5d7dfefa3692316f5e99b325c72bd837648d93ec (patch) | |
tree | f19f2b4baafac7c70132fca3eeadde5c756184d6 | |
parent | 1e1e0f1fbb3c0c3f271649ceaeb2f02f564dd461 (diff) | |
parent | dbc8cae18cabcd6e4d0ccfecda963563a514df52 (diff) | |
download | rtmux-5d7dfefa3692316f5e99b325c72bd837648d93ec.tar.gz rtmux-5d7dfefa3692316f5e99b325c72bd837648d93ec.tar.bz2 rtmux-5d7dfefa3692316f5e99b325c72bd837648d93ec.zip |
Merge branch 'obsd-master'
-rw-r--r-- | cmd-new-session.c | 15 | ||||
-rw-r--r-- | cmd-refresh-client.c | 7 |
2 files changed, 13 insertions, 9 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c index 1813288d..efddc228 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -77,6 +77,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) const char *path, *cmd, *cwd, *to_free = NULL; char **argv, *cause, *cp; int detached, already_attached, idx, argc; + int is_control = 0; u_int sx, sy; struct environ_entry *envent; struct cmd_find_state fs; @@ -139,6 +140,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) detached = args_has(args, 'd'); if (c == NULL) detached = 1; + else if (c->flags & CLIENT_CONTROL) + is_control = 1; /* Is this client already attached? */ already_attached = 0; @@ -185,29 +188,31 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) } /* Find new session size. */ - if (c != NULL) { + if (!detached) { sx = c->tty.sx; sy = c->tty.sy; + if (!is_control && + sy > 0 && + options_get_number(global_s_options, "status")) + sy--; } else { sx = 80; sy = 24; } - if (detached && args_has(args, 'x')) { + if ((is_control || detached) && args_has(args, 'x')) { sx = strtonum(args_get(args, 'x'), 1, USHRT_MAX, &errstr); if (errstr != NULL) { cmdq_error(item, "width %s", errstr); goto error; } } - if (detached && args_has(args, 'y')) { + if ((is_control || detached) && args_has(args, 'y')) { sy = strtonum(args_get(args, 'y'), 1, USHRT_MAX, &errstr); if (errstr != NULL) { cmdq_error(item, "height %s", errstr); goto error; } } - if (sy > 0 && options_get_number(global_s_options, "status")) - sy--; if (sx == 0) sx = 1; if (sy == 0) diff --git a/cmd-refresh-client.c b/cmd-refresh-client.c index 6af3362b..df1d2135 100644 --- a/cmd-refresh-client.c +++ b/cmd-refresh-client.c @@ -67,10 +67,9 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item) cmdq_error(item, "not a control client"); return (CMD_RETURN_ERROR); } - if (tty_set_size(&c->tty, w, h)) { - c->flags |= CLIENT_SIZECHANGED; - recalculate_sizes(); - } + tty_set_size(&c->tty, w, h); + c->flags |= CLIENT_SIZECHANGED; + recalculate_sizes(); } else if (args_has(args, 'S')) { c->flags |= CLIENT_STATUSFORCE; server_status_client(c); |