Add broadcast input mode for multi-session typing
Broadcast mode sends keystrokes from the active terminal to all other connected sessions simultaneously. Useful for applying the same commands across multiple servers. - Toggle via Ctrl+Shift+B keyboard shortcut or broadcast button in tab bar - Visual indicator: broadcast button pulses red when active - Only sends to sessions in 'connected' state - Notification on toggle - State stored in app state object
This commit is contained in:
@@ -92,6 +92,19 @@ class TerminalManager {
|
||||
try {
|
||||
const b64 = btoa(data);
|
||||
window.go.api.Service.WriteSession(sessionId, b64);
|
||||
|
||||
// Broadcast to all other connected sessions if enabled
|
||||
if (this.app.state.broadcastMode) {
|
||||
for (const [otherId] of this.terminals) {
|
||||
if (otherId === sessionId) continue;
|
||||
const otherSession = this.app.state.getSession(otherId);
|
||||
if (otherSession && otherSession.state === 'connected') {
|
||||
try {
|
||||
window.go.api.Service.WriteSession(otherId, b64);
|
||||
} catch (_) { /* non-critical */ }
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('WriteSession error:', err);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user