diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2011-10-23 08:10:11 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2011-10-23 08:10:11 +0000 |
commit | 179d0686d78ec6489572e122dbb50220471531a2 (patch) | |
tree | 2c2913e2e64b21a85d3a9c53becf506ce87a4e3e | |
parent | b32254acda43bc4966565f482ccf911b74a95345 (diff) | |
download | rtmux-179d0686d78ec6489572e122dbb50220471531a2.tar.gz rtmux-179d0686d78ec6489572e122dbb50220471531a2.tar.bz2 rtmux-179d0686d78ec6489572e122dbb50220471531a2.zip |
For initial session, use size of command client even if detached.
-rw-r--r-- | cmd-new-session.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c index 5eaa5393..d576dc61 100644 --- a/cmd-new-session.c +++ b/cmd-new-session.c @@ -154,9 +154,17 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) } /* Find new session size. */ - if (detached) { + if (ctx->cmdclient != NULL) { + sx = ctx->cmdclient->tty.sx; + sy = ctx->cmdclient->tty.sy; + } else if (ctx->curclient != NULL) { + sx = ctx->curclient->tty.sx; + sy = ctx->curclient->tty.sy; + } else { sx = 80; sy = 24; + } + if (detached) { if (args_has(args, 'x')) { sx = strtonum( args_get(args, 'x'), 1, USHRT_MAX, &errstr); @@ -173,12 +181,6 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx) return (-1); } } - } else if (ctx->cmdclient != NULL) { - sx = ctx->cmdclient->tty.sx; - sy = ctx->cmdclient->tty.sy; - } else { - sx = ctx->curclient->tty.sx; - sy = ctx->curclient->tty.sy; } if (sy > 0 && options_get_number(&global_s_options, "status")) sy--; |