summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-07-17 18:45:08 +0000
committernicm <nicm@openbsd.org>2009-07-17 18:45:08 +0000
commit9629a58f00f3e9d74d2b153275ac41fc317e3495 (patch)
treed3cef6c73d916de4d7dbccaa250a67c8ec6d1f00 /usr.bin/tmux/window.c
parentWhen resizing a screen smaller in alternate screen mode, all the lines needed (diff)
downloadwireguard-openbsd-9629a58f00f3e9d74d2b153275ac41fc317e3495.tar.xz
wireguard-openbsd-9629a58f00f3e9d74d2b153275ac41fc317e3495.zip
- New command display-message (alias display) to display a message in the
status line (bound to "i" and displays the current window and time by default). The same substitutions are applied as for status-left/right. - Add support for including the window index (#I), pane index (#P) and window name (#W) in the message, and status-left or status-right. - Bump protocol version. From Tiago Cunha, thanks!
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index 2b9afef3a5d..f4f60fc6f57 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.12 2009/07/15 08:00:49 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.13 2009/07/17 18:45:08 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -380,6 +380,21 @@ window_pane_at_index(struct window *w, u_int idx)
}
u_int
+window_pane_index(struct window *w, struct window_pane *wp)
+{
+ struct window_pane *wq;
+ u_int n;
+
+ n = 0;
+ TAILQ_FOREACH(wq, &w->panes, entry) {
+ if (wp == wq)
+ break;
+ n++;
+ }
+ return (n);
+}
+
+u_int
window_count_panes(struct window *w)
{
struct window_pane *wp;