summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-07-15 08:00:49 +0000
committernicm <nicm@openbsd.org>2009-07-15 08:00:49 +0000
commite63d884a3cc2659ab9ee65dfe7638befaab8aaa7 (patch)
tree24fd898888f55d3c1e25792640d1499b1c3a8d51 /usr.bin/tmux/window.c
parentmust include <sys/types.h> before including <login_cap.h> or <bsd_auth.h>; (diff)
downloadwireguard-openbsd-e63d884a3cc2659ab9ee65dfe7638befaab8aaa7.tar.xz
wireguard-openbsd-e63d884a3cc2659ab9ee65dfe7638befaab8aaa7.zip
The man page says that kill-window removes the window entirely, unlinking it
from any sessions. In fact the implementation only affected the current session, making it the same as unlink-window but destroying the window if it was linked into only one session (unlinkw gives an error). Change the behaviour to match what it documented and was originally intended.
Diffstat (limited to 'usr.bin/tmux/window.c')
-rw-r--r--usr.bin/tmux/window.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c
index dbe8275e169..2b9afef3a5d 100644
--- a/usr.bin/tmux/window.c
+++ b/usr.bin/tmux/window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window.c,v 1.11 2009/07/14 16:52:50 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.12 2009/07/15 08:00:49 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -82,6 +82,19 @@ winlink_cmp(struct winlink *wl1, struct winlink *wl2)
}
struct winlink *
+winlink_find_by_window(struct winlinks *wwl, struct window *w)
+{
+ struct winlink *wl;
+
+ RB_FOREACH(wl, winlinks, wwl) {
+ if (wl->window == w)
+ return (wl);
+ }
+
+ return (NULL);
+}
+
+struct winlink *
winlink_find_by_index(struct winlinks *wwl, int idx)
{
struct winlink wl;