{"record":{"id":"17384d6587df7a76","repo":"zellij-org/zellij","slug":"no-tabs-left-cannot-move-clients-from-close","errorCode":null,"errorMessage":"No tabs left, cannot move clients: {:?} from closed tab","messagePattern":"No tabs left, cannot move clients: (.+?) from closed tab","errorType":"console","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"zellij-server/src/screen.rs","lineNumber":1903,"sourceCode":"            .find(|t| t.position == position)\n            .map(|t| t.id)\n    }\n\n    /// Gets the display position of the tab with the given ID.\n    ///\n    /// Use this to convert ID → position for user-facing operations.\n    fn get_tab_position_by_id(&self, id: usize) -> Option<usize> {\n        self.tabs.get(&id).map(|t| t.position)\n    }\n\n    fn move_clients_from_closed_tab(\n        &mut self,\n        client_ids_and_mode_infos: Vec<(ClientId, ModeInfo)>,\n    ) -> Result<()> {\n        let err_context = || \"failed to move clients from closed tab\".to_string();\n\n        if self.tabs.is_empty() {\n            Err::<(), _>(anyhow!(\n                \"No tabs left, cannot move clients: {:?} from closed tab\",\n                client_ids_and_mode_infos\n            ))\n            .with_context(err_context)\n            .non_fatal();\n\n            return Ok(());\n        }\n        let first_tab_index = *self\n            .tabs\n            .keys()\n            .next()\n            .context(\"screen contained no tabs\")\n            .with_context(err_context)?;\n        let mut arriving_client_ids: HashMap<usize, Vec<ClientId>> = HashMap::new();\n        for (client_id, client_mode_info) in client_ids_and_mode_infos {\n            let client_tab_history = self.tab_history.entry(client_id).or_insert_with(Vec::new);\n            if let Some(client_previous_tab) = client_tab_history.pop() {","sourceCodeStart":1885,"sourceCodeEnd":1921,"githubUrl":"https://github.com/zellij-org/zellij/blob/474ea0cef620c83d6ec05a7c28c7f80c4f63bbbb/zellij-server/src/screen.rs#L1885-L1921","documentation":"Error \"No tabs left, cannot move clients: {:?} from closed tab\" thrown in zellij-org/zellij.","triggerScenarios":"Occurs at zellij-server/src/screen.rs:1848 when the operation fails: \"No tabs left, cannot move clients: {:?} from closed tab\". Currently there is no defensive handling preventing or contextualizing this failure before it surfaces.","commonSituations":"Race between tab close and a client attach/move action, or a stale tab index.","solutions":["Ensure at least one tab exists before attaching or moving clients.","Verify the tab index/name is valid with `zellij action query-tab-names`."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"474ea0cef620c83d6ec05a7c28c7f80c4f63bbbb","analyzedAt":"2026-08-19T07:42:58.758Z","contentChangedAt":"2026-08-19T07:42:58.758Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}