Skip to content

Commit fc7aae9

Browse files
committed
Implement options_after window option
Created new method config_after_window() that applies relevant configurations after windows and panes have been created. Currently, it only knows the `options_after` option. This is useful for setting `synchronize-panes: on` *after* pane creation and shell command execution.
1 parent 634974c commit fc7aae9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tmuxp/workspacebuilder.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ def build(self, session=None):
188188
if 'focus' in wconf and wconf['focus']:
189189
focus = w
190190

191+
self.config_after_window(w, wconf)
192+
191193
if focus_pane:
192194
focus_pane.select_pane()
193195

@@ -308,6 +310,14 @@ def get_pane_start_directory():
308310

309311
yield p, pconf
310312

313+
"""
314+
Applies window configurations relevant after window and pane creation.
315+
"""
316+
def config_after_window(self, w, wconf):
317+
if 'options_after' in wconf and isinstance(wconf['options_after'], dict):
318+
for key, val in wconf['options_after'].items():
319+
w.set_window_option(key, val)
320+
311321

312322
def freeze(session):
313323
"""Freeze live tmux session and Return session config :py:obj:`dict`.

0 commit comments

Comments
 (0)