-
I want to input same key strokes to multiple panes. i.e. press |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
wezterm doesn't support this today |
Beta Was this translation helpful? Give feedback.
-
Since broadcasting was the only feature I was missing in wezterm I'm fiddling with a key binding. I just compose a command in one pane and with SUPER-Enter copy that command to the other panes in the same tab. That's not a full-fledged solution as in iTerm but all I need. It might be useful for somebody else. Caveat: for now, I'm using a dirty trick to grab the command line buffer. I get the whole viewport and cut the beginning off up to the last prompt. So, unfortunately I need a regex to find the prompt. Is there something like { key = 'Enter', mods = 'CMD', action = wezterm.action_callback(function(win, pane)
local prompt_regex = '.+\xee\x82\xb0 ' -- my prompt ends with a powerline character
local tab = pane:tab()
local txt = pane:get_logical_lines_as_text()
local cmd = string.gsub(txt, prompt_regex, '')
wezterm.log_info('Command:', cmd)
for _, p in ipairs(tab:panes()) do
if p:pane_id() == pane:pane_id() then
wezterm.log_info('Sending \\n to own pane', p)
p:send_text('\n')
else
wezterm.log_info('Sending command\\n to pane', p)
p:send_text(cmd..'\n')
end
end
end)
}, |
Beta Was this translation helpful? Give feedback.
wezterm doesn't support this today