From f8ccf68a67910a88b212e36dde2db876793bdd8d Mon Sep 17 00:00:00 2001 From: Gerard Roche Date: Sun, 6 Aug 2023 15:51:45 +0100 Subject: [PATCH] :metal: --- lib/runner.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/lib/runner.py b/lib/runner.py index da57633..c7dd89f 100644 --- a/lib/runner.py +++ b/lib/runner.py @@ -138,6 +138,47 @@ def run(self, working_dir=None, file=None, options=None) -> None: 'options': options }) + # sessions + # $ tmux list-sessions -F '#{session_name}' + # foo + # mx + # + # windows + # $ tmux list-windows -F '#{window_index}' -t mx + # 1 + # 2 + # + # panes + # $ tmux list-panes -t "mx":1 -F '#{pane_index}' + # 1 + + tmux_session = "mx" + tmux_window = 1 + tmux_pane = 1 + + tmux_target = '{}:{}.{}'.format( + tmux_session, + tmux_window, + tmux_pane) + + import shlex + + # tmux_target = 'ls' + # cmd = ['clear; ls -l\n'] + # cmd = ['clear; ' + ' '.join(cmd) + '\n'] + # cmd += ["--filter \"x y\""] + # keys = ' '.join(cmd) + keys = shlex.join(cmd) + print('') + print(' ' + keys) + print(shlex.quote(keys)) + keys += '\n' + + # cmd = ['clear;' + keys] + cmd = [keys] + cmd = ['tmux', 'send-keys', '-t', tmux_target] + cmd + print('cmd =', cmd) + strategy.execute( self.window, self.view,