{"record":{"id":"b4a9e1824067e25a","repo":"zed-industries/zed","slug":"headless-mode-does-not-support-screen-capture","errorCode":null,"errorMessage":"Headless mode does not support screen capture.","messagePattern":"Headless mode does not support screen capture\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_linux/src/linux/headless/client.rs","lineNumber":85,"sourceCode":"        vec![self.0.borrow().display.clone()]\n    }\n\n    fn primary_display(&self) -> Option<Rc<dyn PlatformDisplay>> {\n        Some(self.0.borrow().display.clone())\n    }\n\n    fn display(&self, id: DisplayId) -> Option<Rc<dyn PlatformDisplay>> {\n        let display = self.0.borrow().display.clone();\n        (display.id() == id).then_some(display)\n    }\n\n    #[cfg(feature = \"screen-capture\")]\n    fn screen_capture_sources(\n        &self,\n    ) -> futures::channel::oneshot::Receiver<anyhow::Result<Vec<Rc<dyn gpui::ScreenCaptureSource>>>>\n    {\n        let (tx, rx) = futures::channel::oneshot::channel();\n        tx.send(Err(anyhow::anyhow!(\n            \"Headless mode does not support screen capture.\"\n        )))\n        .ok();\n        rx\n    }\n\n    fn active_window(&self) -> Option<AnyWindowHandle> {\n        None\n    }\n\n    fn window_stack(&self) -> Option<Vec<AnyWindowHandle>> {\n        None\n    }\n\n    fn open_window(\n        &self,\n        _handle: AnyWindowHandle,\n        params: WindowParams,","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/zed-industries/zed/blob/9d272b036335401f339d024ea94968fd51016c40/crates/gpui_linux/src/linux/headless/client.rs#L67-L103","documentation":"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.","triggerScenarios":"Thrown at crates/gpui_linux/src/linux/headless/client.rs:85 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run the app with a windowed (X11/Wayland) platform instead of headless for screen capture","Use a Linux environment with ScreenCaptureKit-equivalent support or a different capture backend","Skip screen-capture features when running in headless/CI contexts"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9d272b036335401f339d024ea94968fd51016c40","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}