zed-industries/zed · error

App is already running

Error message

App is already running

What it means

HeadlessPlatform::run takes the stored Option<EventLoop>; it is None when run() was already called before, so the expect panics with 'App is already running'. GPUI supports exactly one run loop per platform; a second run() call is a caller error.

Source

Thrown at crates/gpui_linux/src/linux/headless/client.rs:139

    fn write_to_primary(&self, _item: gpui::ClipboardItem) {}

    fn write_to_clipboard(&self, _item: gpui::ClipboardItem) {}

    fn read_from_primary(&self) -> Option<gpui::ClipboardItem> {
        None
    }

    fn read_from_clipboard(&self) -> Option<gpui::ClipboardItem> {
        None
    }

    fn run(&self) {
        let mut event_loop = self
            .0
            .borrow_mut()
            .event_loop
            .take()
            .expect("App is already running");

        event_loop.run(None, &mut self.clone(), |_| {}).log_err();
    }
}

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Ensure the application calls Platform::run only once
  2. Don't restart the event loop by re-invoking run from within callbacks
  3. For restarts, create a fresh platform/app instance instead
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/gpui_linux/src/linux/headless/client.rs:139 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/70ab1b3c38df7f06. Report an issue: GitHub.