summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-20 11:37:46 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-20 11:37:46 +0000
commit36475f80e9885588ed6a67f762289f7e56add84f (patch)
tree9c324b1f01c8b0765d48b114402828453fc5d892
parent52b02850ca960f5f540176036200a83ca73f1267 (diff)
Sync OpenBSD patchset 271:
Now that pane targets (-t) are supported, switch some commands to use them where it makes sense: clock-mode, copy-mode, scroll-mode, send-keys, send-prefix.
-rw-r--r--cmd-clock-mode.c10
-rw-r--r--cmd-copy-mode.c8
-rw-r--r--cmd-scroll-mode.c8
-rw-r--r--cmd-send-keys.c14
-rw-r--r--cmd-send-prefix.c10
-rw-r--r--tmux.112
6 files changed, 28 insertions, 34 deletions
diff --git a/cmd-clock-mode.c b/cmd-clock-mode.c
index fd29bf97..037cee3a 100644
--- a/cmd-clock-mode.c
+++ b/cmd-clock-mode.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-clock-mode.c,v 1.5 2009-07-28 22:12:16 tcunha Exp $ */
+/* $Id: cmd-clock-mode.c,v 1.6 2009-08-20 11:37:46 tcunha Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -28,7 +28,7 @@ int cmd_clock_mode_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_clock_mode_entry = {
"clock-mode", NULL,
- CMD_TARGET_WINDOW_USAGE,
+ CMD_TARGET_PANE_USAGE,
0, 0,
cmd_target_init,
cmd_target_parse,
@@ -41,12 +41,12 @@ int
cmd_clock_mode_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_target_data *data = self->data;
- struct winlink *wl;
+ struct window_pane *wp;
- if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
+ if (cmd_find_pane(ctx, data->target, NULL, &wp) == NULL)
return (-1);
- window_pane_set_mode(wl->window->active, &window_clock_mode);
+ window_pane_set_mode(wp, &window_clock_mode);
return (0);
}
diff --git a/cmd-copy-mode.c b/cmd-copy-mode.c
index e4ca0c71..539af9a2 100644
--- a/cmd-copy-mode.c
+++ b/cmd-copy-mode.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-copy-mode.c,v 1.22 2009-07-28 22:12:16 tcunha Exp $ */
+/* $Id: cmd-copy-mode.c,v 1.23 2009-08-20 11:37:46 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -28,7 +28,7 @@ int cmd_copy_mode_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_copy_mode_entry = {
"copy-mode", NULL,
- "[-u] " CMD_TARGET_WINDOW_USAGE,
+ "[-u] " CMD_TARGET_PANE_USAGE,
0, CMD_CHFLAG('u'),
cmd_target_init,
cmd_target_parse,
@@ -41,12 +41,10 @@ int
cmd_copy_mode_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_target_data *data = self->data;
- struct winlink *wl;
struct window_pane *wp;
- if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
+ if (cmd_find_pane(ctx, data->target, NULL, &wp) == NULL)
return (-1);
- wp = wl->window->active;
window_pane_set_mode(wp, &window_copy_mode);
if (wp->mode == &window_copy_mode && data->chflags & CMD_CHFLAG('u'))
diff --git a/cmd-scroll-mode.c b/cmd-scroll-mode.c
index a4cf1e43..34e6a5d2 100644
--- a/cmd-scroll-mode.c
+++ b/cmd-scroll-mode.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-scroll-mode.c,v 1.22 2009-07-28 22:12:16 tcunha Exp $ */
+/* $Id: cmd-scroll-mode.c,v 1.23 2009-08-20 11:37:46 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -29,7 +29,7 @@ int cmd_scroll_mode_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_scroll_mode_entry = {
"scroll-mode", NULL,
- "[-u] " CMD_TARGET_WINDOW_USAGE,
+ "[-u] " CMD_TARGET_PANE_USAGE,
0, CMD_CHFLAG('u'),
cmd_scroll_mode_init,
cmd_target_parse,
@@ -57,12 +57,10 @@ int
cmd_scroll_mode_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_target_data *data = self->data;
- struct winlink *wl;
struct window_pane *wp;
- if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
+ if (cmd_find_pane(ctx, data->target, NULL, &wp) == NULL)
return (-1);
- wp = wl->window->active;
window_pane_set_mode(wp, &window_scroll_mode);
if (wp->mode == &window_scroll_mode && data->chflags & CMD_CHFLAG('u'))
diff --git a/cmd-send-keys.c b/cmd-send-keys.c
index 4887e84a..c0365592 100644
--- a/cmd-send-keys.c
+++ b/cmd-send-keys.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-send-keys.c,v 1.20 2009-07-28 22:12:16 tcunha Exp $ */
+/* $Id: cmd-send-keys.c,v 1.21 2009-08-20 11:37:46 tcunha Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -40,7 +40,7 @@ struct cmd_send_keys_data {
const struct cmd_entry cmd_send_keys_entry = {
"send-keys", "send",
- "[-t target-window] key ...",
+ "[-t target-pane] key ...",
0, 0,
NULL,
cmd_send_keys_parse,
@@ -106,19 +106,17 @@ int
cmd_send_keys_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_send_keys_data *data = self->data;
- struct winlink *wl;
+ struct window_pane *wp;
u_int i;
if (data == NULL)
return (-1);
- if ((wl = cmd_find_window(ctx, data->target, NULL)) == NULL)
+ if (cmd_find_pane(ctx, data->target, NULL, &wp) == NULL)
return (-1);
- for (i = 0; i < data->nkeys; i++) {
- window_pane_key(
- wl->window->active, ctx->curclient, data->keys[i]);
- }
+ for (i = 0; i < data->nkeys; i++)
+ window_pane_key(wp, ctx->curclient, data->keys[i]);
return (0);
}
diff --git a/cmd-send-prefix.c b/cmd-send-prefix.c
index d06833ec..4620e123 100644
--- a/cmd-send-prefix.c
+++ b/cmd-send-prefix.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-send-prefix.c,v 1.25 2009-07-28 22:12:16 tcunha Exp $ */
+/* $Id: cmd-send-prefix.c,v 1.26 2009-08-20 11:37:46 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -28,7 +28,7 @@ int cmd_send_prefix_exec(struct cmd *, struct cmd_ctx *);
const struct cmd_entry cmd_send_prefix_entry = {
"send-prefix", NULL,
- CMD_TARGET_WINDOW_USAGE,
+ CMD_TARGET_PANE_USAGE,
0, 0,
cmd_target_init,
cmd_target_parse,
@@ -42,14 +42,14 @@ cmd_send_prefix_exec(struct cmd *self, struct cmd_ctx *ctx)
{
struct cmd_target_data *data = self->data;
struct session *s;
- struct winlink *wl;
+ struct window_pane *wp;
int key;
- if ((wl = cmd_find_window(ctx, data->target, &s)) == NULL)
+ if (cmd_find_pane(ctx, data->target, &s, &wp) == NULL)
return (-1);
key = options_get_number(&s->options, "prefix");
- window_pane_key(wl->window->active, ctx->curclient, key);
+ window_pane_key(wp, ctx->curclient, key);
return (0);
}
diff --git a/tmux.1 b/tmux.1
index 5d091b66..275c11df 100644
--- a/tmux.1
+++ b/tmux.1
@@ -1,4 +1,4 @@
-.\" $Id: tmux.1,v 1.153 2009-08-20 11:22:47 tcunha Exp $
+.\" $Id: tmux.1,v 1.154 2009-08-20 11:37:46 tcunha Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -528,7 +528,7 @@ The mode commands are as follows:
.Bl -tag -width Ds
.It Xo Ic copy-mode
.Op Fl u
-.Op Fl t Ar target-window
+.Op Fl t Ar target-pane
.Xc
Enter copy mode.
The
@@ -536,7 +536,7 @@ The
option scrolls one page up.
.It Xo Ic scroll-mode
.Op Fl u
-.Op Fl t Ar target-window
+.Op Fl t Ar target-pane
.Xc
Enter scroll mode.
The
@@ -970,7 +970,7 @@ are listed; this may be one of:
or
.Em emacs-copy .
.It Xo Ic send-keys
-.Op Fl t Ar target-window
+.Op Fl t Ar target-pane
.Ar key Ar ...
.Xc
.D1 (alias: Ic send )
@@ -984,7 +984,7 @@ or
) to send; if the string is not recognised as a key, it is sent as a series of
characters.
All arguments are sent sequentially from first to last.
-.It Ic send-prefix Op Fl t Ar target-window
+.It Ic send-prefix Op Fl t Ar target-pane
Send the prefix key to a window as if it was pressed.
.It Xo Ic unbind-key
.Op Fl cn
@@ -1799,7 +1799,7 @@ Display the contents of the specified buffer.
.Pp
Miscellaneous commands are as follows:
.Bl -tag -width Ds
-.It Ic clock-mode Op Fl t Ar target-window
+.It Ic clock-mode Op Fl t Ar target-pane
Display a large clock.
.It Ic if-shell Ar shell-command command
.D1 (alias: Ic if )