gardesk/garterm / 2ed0160

Browse files

fix: process PTY output for all tabs, not just active

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
2ed0160f2fd19812093b06fe7e7489fd7a907ad6
Parents
9ae74bd
Tree
b33302a

2 changed files

StatusFile+-
M garterm/src/app.rs 3 3
M garterm/src/ui/manager.rs 5 0
garterm/src/app.rsmodified
@@ -240,9 +240,9 @@ impl App {
240240
             // Handle IPC commands
241241
             self.handle_ipc()?;
242242
 
243
-            // Read from ALL panes in the active tab (non-blocking)
244
-            // This ensures unfocused panes still receive PTY data
245
-            if let Some(tab) = self.tabs.active_tab_mut() {
243
+            // Read from ALL panes in ALL tabs (non-blocking)
244
+            // This ensures background tabs still receive PTY data and can run startup commands
245
+            for tab in self.tabs.all_tabs_mut() {
246246
                 for pane in tab.panes.values_mut() {
247247
                     loop {
248248
                         match pane.read_pty(&mut buf) {
garterm/src/ui/manager.rsmodified
@@ -89,6 +89,11 @@ impl TabManager {
8989
         self.active_tab_mut().and_then(|t| t.focused_pane_mut())
9090
     }
9191
 
92
+    /// Iterate over all tabs mutably
93
+    pub fn all_tabs_mut(&mut self) -> impl Iterator<Item = &mut Tab> {
94
+        self.tabs.values_mut()
95
+    }
96
+
9297
     /// Create a new tab
9398
     pub fn new_tab(
9499
         &mut self,