Emit from cli #1558
Replies: 2 comments 11 replies
-
There's a bit of nuance to this, similar to focusing-a-pane-via-the-CLI discussion/monologue in #1531. A multiplexer server may have multiple clients connected from multiple locations, so this sort of event emission should probably have a way to specify which client(s) should receive that message in case the event handler that a user has configured is not "idempotent" or is otherwise dangerous/risky to repeat on multiple machines at once. Passing arbitrary arguments isn't directly compatible with EmitEvent, which is also is only applicable to GUI clients. What are you planning to do with this functionality? Does it make sense to only allow it to reach a gui client if it is present? |
Beta Was this translation helpful? Give feedback.
-
This would allow us to do things like have an action make a split to open, say, # emits "split-response" event with pane ID and result of an `fzf` query or whatever
wezterm cli emit split-response 4 "./some/path/to/file.whatever" -- wezterm.lua
wezterm.on("split-response", function(win, pane, paneID, result)
window:perform_action(
wezterm.action_callback(function(_, pane)
pane:paste(result)
end,
paneID
)
end) |
Beta Was this translation helpful? Give feedback.
-
Maybe there is a way to do this already that I couldn't find, but it would be a great addition to allow emitting events from the CLI.
Something like this:
Beta Was this translation helpful? Give feedback.
All reactions