diff options
author | 2018-06-08 09:43:58 +0000 | |
---|---|---|
committer | 2018-06-08 09:43:58 +0000 | |
commit | 47ace6ab0debdff7cc32ddc94c06d24a34c01a9b (patch) | |
tree | a6b50b5c49dbb89250b01607f0ed75e1627d359a /usr.bin | |
parent | Add -x- and -y- to use client size, from Stefan Assmann in GitHub issue 1372. (diff) | |
download | wireguard-openbsd-47ace6ab0debdff7cc32ddc94c06d24a34c01a9b.tar.xz wireguard-openbsd-47ace6ab0debdff7cc32ddc94c06d24a34c01a9b.zip |
Tweak previous - check for a NULL client and simplify manual text.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/cmd-new-session.c | 16 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.1 | 7 |
2 files changed, 13 insertions, 10 deletions
diff --git a/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c index 510b956ded7..8e2b6a33aec 100644 --- a/usr.bin/tmux/cmd-new-session.c +++ b/usr.bin/tmux/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.112 2018/06/08 09:41:34 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.113 2018/06/08 09:43:58 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -203,9 +203,10 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) } if ((is_control || detached) && args_has(args, 'x')) { tmp = args_get(args, 'x'); - if (strcmp(tmp, "-") == 0) - sx = c->tty.sx; - else { + 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); @@ -215,9 +216,10 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) } if ((is_control || detached) && args_has(args, 'y')) { tmp = args_get(args, 'y'); - if (strcmp(tmp, "-") == 0) - sy = c->tty.sy; - else { + 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); diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1 index 8035329b8f5..60a9ecbaeea 100644 --- a/usr.bin/tmux/tmux.1 +++ b/usr.bin/tmux/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.601 2018/06/08 09:41:34 nicm Exp $ +.\" $OpenBSD: tmux.1,v 1.602 2018/06/08 09:43:58 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> .\" @@ -850,8 +850,9 @@ the initial size is 80 x 24; .Fl x and .Fl y -can be used to specify a different size, with the special case "-" which uses -the size of the current terminal. +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 |