summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-09-07 21:12:13 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-09-07 21:12:13 +0000
commit4ce731d151c39a6e5c68c9ce6a1a24ee37d52622 (patch)
treeccd33bed62f5e4c43b93a188b28bb4d097463531 /usr.bin
parent6347ae1b8c27e6d1e8aed4018e7dfc9017cf477b (diff)
While the display-panes indicator is on screen, make the number keys select the
pane with that index.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/server.c17
-rw-r--r--usr.bin/tmux/tmux.17
2 files changed, 20 insertions, 4 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 6b11cc749c8..e8ea7435cc0 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.31 2009/09/07 21:01:50 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.32 2009/09/07 21:12:12 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -795,6 +795,7 @@ server_accept_client(int srv_fd)
void
server_handle_client(struct client *c)
{
+ struct window *w;
struct window_pane *wp;
struct screen *s;
struct timeval tv;
@@ -818,8 +819,18 @@ server_handle_client(struct client *c)
if (c->session == NULL)
return;
- wp = c->session->curw->window->active; /* could die */
-
+ w = c->session->curw->window;
+ wp = w->active; /* could die */
+
+ /* Special case: number keys jump to pane in identify mode. */
+ if (c->flags & CLIENT_IDENTIFY && key >= '0' && key <= '9') {
+ wp = window_pane_at_index(w, key - '0');
+ if (wp != NULL && window_pane_visible(wp))
+ window_set_active_pane(w, wp);
+ server_clear_identify(c);
+ continue;
+ }
+
status_message_clear(c);
server_clear_identify(c);
if (c->prompt_string != NULL) {
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index cdff7b508ca..f1c03047c05 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.83 2009/09/07 10:49:32 nicm Exp $
+.\" $OpenBSD: tmux.1,v 1.84 2009/09/07 21:12:12 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -689,6 +689,11 @@ See the
and
.Ic display-panes-colour
session options.
+While the indicator is on screen, a pane may be selected with the
+.Ql 0
+to
+.Ql 9
+keys.
.It Ic down-pane Op Fl t Ar target-pane
.D1 (alias: Ic downp )
Move down a pane.