Send input to multiple panes #3227
Replies: 6 comments 3 replies
-
For me is the only feature I'm missing from iTerm2. For now I will use tmux when I will need to broadcast input to more panes but it will be awesome if can be implemented as Ghostty Action. |
Beta Was this translation helpful? Give feedback.
-
Seconding this. This feature exists in Tilix and in Kitty using the broadcast kitten This is huge time saver for me as a dev ops, i would absolutely love to see it in Ghostty. |
Beta Was this translation helpful? Give feedback.
-
can't you do this with the prefix all:
or are you asking for a more selective version of this. |
Beta Was this translation helpful? Give feedback.
-
I don't know any Zig but this repo is so delightfully readable I couldn't help poking around a bit. Looks like input is read in a separate thread in Exec.zig. input is sent to termio.Termio.processOutput which ends up calling Terminal.print. Terminal owns a Screen which has a PageList that is essentially a linked list of "pages", which is the individual terminal pane. Look like we'd have to spread the input across these panes. Issue is, the Screen is the one that owns the concept of a "cursor", not the individual pages. Attached to the cursor are other concepts that would need addressing like knowing which link is currently active (the url under the cursor), the cursor's current style (which the renderer assumes there is only one of), the concept of page "pins", how that interacts with mouse controls (absolute vs relative cursor movements), and in general a bunch of optimizations that rely on there being only one cursor. I think adding multi cursor support is a big ask, but maybe its easier to split the functionality of typing in a pane to a new type of cursor that is local to the pane while the screen's cursor remains the global "interactive" cursor? Edit: Actually, it'd probably be easier to hack in something that emulates synchronized inputs by having each pane remember keep a copy of the global cursor at the point in time when the cursor was last active in the pane. then, on input, iterate through all panes, restore the global cursor to the pane's cursor, apply the input and at the end restore to the global cursor? |
Beta Was this translation helpful? Give feedback.
-
The docs sound like
I only have iTerm's implementation as reference, but this sounds roughly like what I expect. iTerm seems to internally keep a single active pane as after you disable input broadcast it goes back to whichever pane was last active and the cursor is in the same state it was just in. I found this iTerm page with a sample python script that might be of interest. |
Beta Was this translation helpful? Give feedback.
-
It is definitely the only feature that I'm missing from iTerm2. |
Beta Was this translation helpful? Give feedback.
-
It would be great to have the ability to send the same input to multiple panes in the current active tab.
iTerm does this and is greatly missed.
Beta Was this translation helpful? Give feedback.
All reactions