diff options
-rw-r--r-- | cmd-set-window-option.c | 1 | ||||
-rw-r--r-- | tmux.1 | 5 | ||||
-rw-r--r-- | tmux.c | 1 | ||||
-rw-r--r-- | window.c | 16 |
4 files changed, 21 insertions, 2 deletions
diff --git a/cmd-set-window-option.c b/cmd-set-window-option.c index 76d00e19..1ac62147 100644 --- a/cmd-set-window-option.c +++ b/cmd-set-window-option.c @@ -64,6 +64,7 @@ const struct set_option_entry set_window_option_table[] = { { "monitor-activity", SET_OPTION_FLAG, 0, 0, NULL }, { "monitor-content", SET_OPTION_STRING, 0, 0, NULL }, { "remain-on-exit", SET_OPTION_FLAG, 0, 0, NULL }, + { "synchronize-panes", SET_OPTION_FLAG, 0, 0, NULL }, { "utf8", SET_OPTION_FLAG, 0, 0, NULL }, { "window-status-attr", SET_OPTION_ATTRIBUTES, 0, 0, NULL }, { "window-status-bg", SET_OPTION_COLOUR, 0, 0, NULL }, @@ -1662,6 +1662,11 @@ The window may be reactivated with the .Ic respawn-window command. .Pp +.It Xo Ic synchronize-panes +.Op Ic on | off +.Xc +Duplicate input to any pane to all other panes in the same window, except +for panes that are not in output mode. .It Xo Ic utf8 .Op Ic on | off .Xc @@ -441,6 +441,7 @@ main(int argc, char **argv) options_set_number(wo, "window-status-fg", 8); options_set_number(wo, "xterm-keys", 0); options_set_number(wo, "remain-on-exit", 0); + options_set_number(wo, "synchronize-panes", 0); if (flags & IDENTIFY_UTF8) { options_set_number(so, "status-utf8", 1); @@ -610,14 +610,26 @@ window_pane_parse(struct window_pane *wp) void window_pane_key(struct window_pane *wp, struct client *c, int key) { + struct window_pane *wp2; + if (wp->fd == -1 || !window_pane_visible(wp)) return; if (wp->mode != NULL) { if (wp->mode->key != NULL) wp->mode->key(wp, c, key); - } else - input_key(wp, key); + return; + } + + input_key(wp, key); + if (options_get_number(&wp->window->options, "synchronize-panes")) { + TAILQ_FOREACH(wp2, &wp->window->panes, entry) { + if (wp2 == wp || wp2->mode != NULL) + continue; + if (wp2->fd != -1 && window_pane_visible(wp2)) + input_key(wp2, key); + } + } } void |