summaryrefslogtreecommitdiffstats
path: root/cmd-new-session.c
diff options
context:
space:
mode:
authornicm <nicm>2020-04-09 13:57:18 +0000
committernicm <nicm>2020-04-09 13:57:18 +0000
commitb0b07fb585310175b22d1e1f14db42138f08cd6d (patch)
tree4d3fcb815c105746f54505a4c04362ba34fcede8 /cmd-new-session.c
parent886fdb1f7e185d47d8ddff0eb3bd1b1835f0d0c9 (diff)
Tweak how the default size is worked out so it is more obvious.
Diffstat (limited to 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index a75fc972..725448fd 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -207,7 +207,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
goto fail;
}
}
- }
+ } else
+ dsx = 80;
if (args_has(args, 'y')) {
tmp = args_get(args, 'y');
if (strcmp(tmp, "-") == 0) {
@@ -222,7 +223,8 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
goto fail;
}
}
- }
+ } else
+ dsy = 24;
/* Find new session size. */
if (!detached && !is_control) {
@@ -233,13 +235,14 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
} else {
tmp = options_get_string(global_s_options, "default-size");
if (sscanf(tmp, "%ux%u", &sx, &sy) != 2) {
- sx = 80;
- sy = 24;
- }
- if (args_has(args, 'x'))
sx = dsx;
- if (args_has(args, 'y'))
sy = dsy;
+ } else {
+ if (args_has(args, 'x'))
+ sx = dsx;
+ if (args_has(args, 'y'))
+ sy = dsy;
+ }
}
if (sx == 0)
sx = 1;