summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/tmux/cmd.c6
-rw-r--r--usr.bin/tmux/tmux.110
2 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c
index cd46d13cec2..d1f1da30cc2 100644
--- a/usr.bin/tmux/cmd.c
+++ b/usr.bin/tmux/cmd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd.c,v 1.72 2012/11/27 09:20:03 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.73 2012/12/24 12:38:57 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -863,6 +863,10 @@ cmd_find_window(struct cmd_ctx *ctx, const char *arg, struct session **sp)
wl = s->curw;
else if (winptr[0] == '!' && winptr[1] == '\0')
wl = TAILQ_FIRST(&s->lastw);
+ else if (winptr[0] == '^' && winptr[1] == '\0')
+ wl = RB_MIN(winlinks, &s->windows);
+ else if (winptr[0] == '$' && winptr[1] == '\0')
+ wl = RB_MAX(winlinks, &s->windows);
else if (winptr[0] == '+' || winptr[0] == '-')
wl = cmd_find_window_offset(winptr, s, &ambiguous);
else
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index 834c3f411a7..23235ca8bbe 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.310 2012/12/24 12:34:32 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.311 2012/12/24 12:38:57 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -408,11 +408,15 @@ otherwise the current window in
is chosen.
The special character
.Ql \&!
-uses the last (previously current) window, or
+uses the last (previously current) window,
+.Ql ^
+selects the highest numbered window,
+.Ql $
+selects the lowest numbered window, and
.Ql +
and
.Ql -
-are the next window or the previous window by number.
+select the next window or the previous window by number.
When the argument does not contain a colon,
.Nm
first attempts to parse it as window; if that fails, an attempt is made to