diff --git a/src/main.rs b/src/main.rs index edee78d..231e967 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3622,6 +3622,10 @@ impl Application for App { stream::channel( 100, |mut output: iced::futures::channel::mpsc::Sender| async move { + // Bounded: when the GUI can't drain fast enough, alacritty's PTY reader + // blocks on send → kernel pipe fills → producing program is throttled by + // the OS. Capacity 1024 caps the queue depth; per-event memory depends on + // payload (Wakeup is ~100 B; Title/PtyWrite carry owned Strings). let (event_tx, mut event_rx) = mpsc::channel(1024); output.send(Message::TermEventTx(event_tx)).await.unwrap(); diff --git a/src/terminal.rs b/src/terminal.rs index ecfb602..8d8b469 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -104,7 +104,10 @@ pub struct EventProxy( impl EventListener for EventProxy { fn send_event(&self, event: Event) { - //TODO: handle error + // Bounded channel; blocking_send propagates backpressure to alacritty's + // PTY reader instead of letting events accumulate. Called from alacritty's + // std::thread PTY reader (not a tokio worker), so blocking is safe and + // blocking_send won't panic. let _ = self.2.blocking_send((self.0, self.1, event)); } }