This allows one to select the last window (not last-window but window with
highest index), so one can bind it to 'select-window -t:$' to jump to the end
window, and similary bind to 'select-window -t:^' to jump to the first window
(first determined by base-index).

Signed-off-by: Raghavendra D Prabhu <rpra...@wnohang.net>
---
 cmd.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cmd.c b/cmd.c
index 4a17ddc..35dadc1 100644
--- a/cmd.c
+++ b/cmd.c
@@ -592,6 +592,16 @@ cmd_lookup_window(struct session *s, const char *name, int 
*ambiguous)
        if ((wl = cmd_lookup_winlink_windowid(s, name)) != NULL)
            return (wl);
 
+       if (*name == '$') {
+               if ((wlfound = RB_MAX(winlinks, &s->windows)) != NULL)
+                       return (wlfound);
+       }
+
+       if (*name == '^') {
+               if ((wlfound = RB_MIN(winlinks, &s->windows)) != NULL)
+                       return (wlfound);
+       }
+
        /* First see if this is a valid window index in this session. */
        idx = strtonum(name, 0, INT_MAX, &errstr);
        if (errstr == NULL) {
-- 
1.8.0


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to