aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2018-06-08 13:02:25 +0100
committerThomas Adam <thomas@xteddy.org>2018-06-08 13:02:25 +0100
commit713e0ddef3ad593b990bd0e71f5fcbe177212a5e (patch)
treeee42411611268aaa0c40505e81a7b4d6173c6984
parent91280f1fcaf956cb92fbdc8991b1e58d28f5d243 (diff)
parentff45b2d343fea6b0c477ed2cb5bbe2d30922ea3e (diff)
downloadrtmux-713e0ddef3ad593b990bd0e71f5fcbe177212a5e.tar.gz
rtmux-713e0ddef3ad593b990bd0e71f5fcbe177212a5e.tar.bz2
rtmux-713e0ddef3ad593b990bd0e71f5fcbe177212a5e.zip
Merge branch 'obsd-master'
-rw-r--r--cmd-new-session.c28
-rw-r--r--tmux.12
2 files changed, 22 insertions, 8 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index 7af67a11..e809de24 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -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)
diff --git a/tmux.1 b/tmux.1
index 1d7e460e..7126e98f 100644
--- a/tmux.1
+++ b/tmux.1
@@ -855,6 +855,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