diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2012-12-24 12:38:57 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2012-12-24 12:38:57 +0000 |
commit | 854e8ae04d15c16b688ba38119656aee134548dd (patch) | |
tree | d7cec2fd3c9be238bf67b1ba769db03f66261495 | |
parent | 3e6d45acf67e37db3614a581ab5aaa3b9509a430 (diff) | |
download | rtmux-854e8ae04d15c16b688ba38119656aee134548dd.tar.gz rtmux-854e8ae04d15c16b688ba38119656aee134548dd.tar.bz2 rtmux-854e8ae04d15c16b688ba38119656aee134548dd.zip |
Add ^ and $ special command targets to select lowest and highest
numbered windows, from Raghavendra D Prabhu.
-rw-r--r-- | cmd.c | 4 | ||||
-rw-r--r-- | tmux.1 | 19 |
2 files changed, 20 insertions, 3 deletions
@@ -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 @@ -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 @@ -1126,6 +1130,7 @@ This command works only from inside .Ic choose-tree .Op Fl s .Op Fl w +.Op Fl u .Op Fl b Ar session-template .Op Fl c Ar window-template .Op Fl S Ar format @@ -1151,6 +1156,9 @@ If .Fl w is given, will show windows. If +.Fl u +is given, the tree is uncollapsed by default. +If .Fl b is given, will override the default session command. Note that @@ -1639,7 +1647,7 @@ is the same as using the .Ic last-pane command. .It Xo Ic select-window -.Op Fl lnp +.Op Fl lnpT .Op Fl t Ar target-window .Xc .D1 (alias: Ic selectw ) @@ -1655,6 +1663,11 @@ are equivalent to the and .Ic previous-window commands. +If +.Fl T +is given and the selected window is already the current window, +the command behaves like +.Ic last-window . .It Xo Ic split-window .Op Fl dhvP .Op Fl c Ar start-directory |