zed-industries/zed · error

Headless mode does not support screen capture.

Error message

Headless mode does not support screen capture.

What it means

Stub in the headless Linux platform's screen_capture_sources: headless clients have no display content to capture, so the returned oneshot receiver resolves to this error whenever screen capture is requested.

Source

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

        vec![self.0.borrow().display.clone()]
    }

    fn primary_display(&self) -> Option<Rc<dyn PlatformDisplay>> {
        Some(self.0.borrow().display.clone())
    }

    fn display(&self, id: DisplayId) -> Option<Rc<dyn PlatformDisplay>> {
        let display = self.0.borrow().display.clone();
        (display.id() == id).then_some(display)
    }

    #[cfg(feature = "screen-capture")]
    fn screen_capture_sources(
        &self,
    ) -> futures::channel::oneshot::Receiver<anyhow::Result<Vec<Rc<dyn gpui::ScreenCaptureSource>>>>
    {
        let (tx, rx) = futures::channel::oneshot::channel();
        tx.send(Err(anyhow::anyhow!(
            "Headless mode does not support screen capture."
        )))
        .ok();
        rx
    }

    fn active_window(&self) -> Option<AnyWindowHandle> {
        None
    }

    fn window_stack(&self) -> Option<Vec<AnyWindowHandle>> {
        None
    }

    fn open_window(
        &self,
        _handle: AnyWindowHandle,
        params: WindowParams,

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Run the app with a windowed (X11/Wayland) platform instead of headless for screen capture
  2. Use a Linux environment with ScreenCaptureKit-equivalent support or a different capture backend
  3. Skip screen-capture features when running in headless/CI contexts
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/gpui_linux/src/linux/headless/client.rs:85 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/b4a9e1824067e25a. Report an issue: GitHub.