Tweak previous - check for a NULL client and simplify manual text.

pull/1374/merge
nicm 2018-06-08 09:43:58 +00:00
parent ba31d3a88c
commit ff45b2d343
2 changed files with 22 additions and 8 deletions

View File

@ -202,17 +202,29 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item)
sy = 24;
}
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;
tmp = args_get(args, 'x');
if (strcmp(tmp, "-") == 0) {
if (c != NULL)
sx = c->tty.sx;
} else {
sx = strtonum(tmp, 1, USHRT_MAX, &errstr);
if (errstr != NULL) {
cmdq_error(item, "width %s", errstr);
goto error;
}
}
}
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;
tmp = args_get(args, 'y');
if (strcmp(tmp, "-") == 0) {
if (c != NULL)
sy = c->tty.sy;
} else {
sy = strtonum(tmp, 1, USHRT_MAX, &errstr);
if (errstr != NULL) {
cmdq_error(item, "height %s", errstr);
goto error;
}
}
}
if (sx == 0)

2
tmux.1
View File

@ -851,6 +851,8 @@ the initial size is 80 x 24;
and
.Fl y
can be used to specify a different size.
.Ql -
uses the size of the current client if any.
.Pp
If run from a terminal, any
.Xr termios 4