aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-15 19:27:31 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-15 19:27:31 +0000
commitd29ca39e0eb6a47986d05ebefce23349e1635c00 (patch)
tree0a087fa32b7bd8746443c21e5f473aa14cbc1004 /server.c
parentc5c4cc7557f107547d3de8f530395f87fa37d1ee (diff)
downloadrtmux-d29ca39e0eb6a47986d05ebefce23349e1635c00.tar.gz
rtmux-d29ca39e0eb6a47986d05ebefce23349e1635c00.tar.bz2
rtmux-d29ca39e0eb6a47986d05ebefce23349e1635c00.zip
Two new commands, choose-window and choose-session which work only when bound to a key and allow the window or session to be selected from a list.
Diffstat (limited to 'server.c')
-rw-r--r--server.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/server.c b/server.c
index 25b27ef9..95dc60f3 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.102 2009-01-14 22:29:28 nicm Exp $ */
+/* $Id: server.c,v 1.103 2009-01-15 19:27:31 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -58,6 +58,18 @@ void server_check_timers(struct client *);
void server_second_timers(void);
int server_update_socket(const char *);
+int
+server_client_index(struct client *c)
+{
+ u_int i;
+
+ for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
+ if (c == ARRAY_ITEM(&clients, i))
+ return (i);
+ }
+ return (-1);
+}
+
/* Fork new server. */
int
server_start(const char *path)
@@ -645,7 +657,7 @@ server_handle_client(struct client *c)
/* Dispatch the command. */
key_bindings_dispatch(bd, c);
- }
+ }
wp = wl->window->active; /* could die - reset again */
/* Ensure the cursor is in the right place and correctly on or off. */