openai/codex · error · std::io::Error

terminal input stream closed during startup

Error message

terminal input stream closed during startup

What it means

Error "terminal input stream closed during startup" thrown in openai/codex.

Source

Thrown at codex-rs/tui/src/startup_draft.rs:216

        }
        Ok(())
    }

    /// Poll one existing startup future alongside the original terminal input stream.
    pub(crate) async fn run_until<F>(&mut self, tui: &mut Tui, future: F) -> io::Result<F::Output>
    where
        F: Future,
    {
        if self.initial_screen == StartupDraftInitialScreen::Composer {
            self.draw(tui, tui.terminal.last_known_screen_size)?;
        }
        tokio::pin!(future);
        loop {
            tokio::select! {
                output = &mut future => return Ok(output),
                event = self.events.next() => {
                    let Some(event) = event else {
                        return Err(io::Error::new(
                            io::ErrorKind::UnexpectedEof,
                            "terminal input stream closed during startup",
                        ));
                    };
                    self.handle_event(tui, event)?;
                }
            }
        }
    }

    /// Preserve pending draft edits while continuing to reject startup actions and submission.
    pub(crate) async fn flush_pending_events(&mut self, tui: &mut Tui) -> io::Result<()> {
        loop {
            for _ in 0..STARTUP_EVENT_BATCH_SIZE {
                let Poll::Ready(Some(event)) = std::future::poll_fn(|context| {
                    Poll::Ready(self.events.as_mut().poll_next(context))
                })
                .await

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/tui/src/startup_draft.rs:216 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/40119ca630948791. Report an issue: GitHub.