# HG changeset patch # User Yasutaka Higa # Date 1405940842 -32400 # Node ID 4d8f8b2bb7a925dc26ef530af3084bc7122a839c # Parent 8ebb2d95496865400806dca087aca35e7746301a Implement synchronize panes note: https://github.com/tmuxinator/tmuxinator/pull/97 diff -r 8ebb2d954968 -r 4d8f8b2bb7a9 lib/pmuxinator/assets/debugger.yml --- a/lib/pmuxinator/assets/debugger.yml Mon Jul 21 19:38:24 2014 +0900 +++ b/lib/pmuxinator/assets/debugger.yml Mon Jul 21 20:07:22 2014 +0900 @@ -13,4 +13,4 @@ panes: - echo hg update -r 100 - echo hg update -r 50 - synchironize: true + synchronize: true diff -r 8ebb2d954968 -r 4d8f8b2bb7a9 lib/pmuxinator/assets/template.erb --- a/lib/pmuxinator/assets/template.erb Mon Jul 21 19:38:24 2014 +0900 +++ b/lib/pmuxinator/assets/template.erb Mon Jul 21 20:07:22 2014 +0900 @@ -55,6 +55,7 @@ <%= window.tmux_select_first_pane %> <%- end -%> + <%= window.tmux_synchronize_panes %> <%- end -%> <%= tmux %> select-window -t <%= base_index %> diff -r 8ebb2d954968 -r 4d8f8b2bb7a9 lib/pmuxinator/window.rb --- a/lib/pmuxinator/window.rb Mon Jul 21 19:38:24 2014 +0900 +++ b/lib/pmuxinator/window.rb Mon Jul 21 20:07:22 2014 +0900 @@ -11,12 +11,14 @@ @pre = nil @project = project @index = index + @synchronize = false value = window_yaml.values.first if value.is_a?(Hash) @layout = value["layout"] ? value["layout"].shellescape : nil @pre = value["pre"] if value["pre"] + @synchronize = value['synchronize'] unless value['synchronize'].blank? @panes = build_panes(value["panes"]) else @@ -86,5 +88,13 @@ def tmux_select_first_pane "#{project.tmux} select-pane -t #{tmux_window_target}.#{panes.first.index + project.base_index}" end + + def tmux_synchronize_panes + if @synchronize + "#{project.tmux} set-window-option -t #{tmux_window_target} synchronize-panes on" + else + '' + end + end end end