{"record":{"id":"1c95c87c4db1be5e","repo":"zellij-org/zellij","slug":"tab-index-not-found","errorCode":null,"errorMessage":"Tab index {:?} not found","messagePattern":"Tab index (.+?) not found","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"zellij-server/src/screen.rs","lineNumber":2020,"sourceCode":"                        .with_context(err_context)?;\n                        match (\n                            should_change_pane_focus,\n                            self.get_indexed_tab_mut(new_tab_index),\n                        ) {\n                            (Some(direction), Some(new_tab)) => {\n                                new_tab.focus_pane_on_edge(direction, client_id);\n                            },\n                            _ => {},\n                        }\n                        self.update_client_tab_focus(client_id, new_tab_index);\n                    }\n\n                    if let Some(current_tab) = self.get_indexed_tab_mut(current_tab_index) {\n                        if current_tab.has_no_connected_clients() {\n                            current_tab.visible(false).with_context(err_context)?;\n                        }\n                    } else {\n                        Err::<(), _>(anyhow!(\"Tab index {:?} not found\", current_tab_index))\n                            .with_context(err_context)\n                            .non_fatal();\n                    }\n\n                    // Clear tab bell notification for the newly active tab\n                    if let Some(new_tab) = self.tabs.get_mut(&new_tab_index) {\n                        let tab_id = new_tab.id;\n                        new_tab.clear_tab_bell_notification();\n                        let _ = self\n                            .bus\n                            .senders\n                            .send_to_background_jobs(BackgroundJob::StopFlashTabBell(tab_id));\n                    }\n\n                    self.recompute_tab_size(current_tab_index)\n                        .with_context(err_context)?;\n                    self.recompute_tab_size(new_tab_index)\n                        .with_context(err_context)?;","sourceCodeStart":2002,"sourceCodeEnd":2038,"githubUrl":"https://github.com/zellij-org/zellij/blob/98a0837077492d53dd252ab30bc3e43e41e504f4/zellij-server/src/screen.rs#L2002-L2038","documentation":"After switching a client to a new tab, the screen re-fetches the previously active tab by index to hide it. get_indexed_tab_mut(current_tab_index) returned None — that index no longer maps to a live Tab — so zellij logs this non-fatal error and continues with the switch.","triggerScenarios":"The old tab was closed concurrently (by another client, a plugin, or a command) between recording current_tab_index and the post-switch bookkeeping; or tab indices were renumbered by an insert/close in the same instruction batch.","commonSituations":"Fast tab switching combined with tab-close keybindings; multiple clients manipulating tabs simultaneously; plugins issuing switch-tab and close-tab actions in quick succession.","solutions":["No action required — non-fatal; the visible effect (old tab not hidden) self-corrects on the next render","Avoid firing switch-tab and close-tab for the same tab in one action batch","If it recurs constantly, report upstream with a reproduction — it indicates a tab-index desync"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":"fn tab_exists(tabs: &BTreeMap<usize, Tab>, index: usize) -> bool {\n    tabs.contains_key(&index)\n}","tryCatchPattern":"if let Some(current_tab) = self.get_indexed_tab_mut(current_tab_index) {\n    if current_tab.has_no_connected_clients() { current_tab.visible(false).with_context(err_context)?; }\n} else {\n    Err::<(), _>(anyhow!(\"Tab index {:?} not found\", current_tab_index)).with_context(err_context).non_fatal();\n}","preventionTips":["Don't combine switch-tab and close-tab for the same tab in one action batch","Report persistent occurrences upstream as a tab-index desync"],"tags":["tabs","race","index","non-fatal","focus"],"backgroundTag":null,"analyzedSha":"98a0837077492d53dd252ab30bc3e43e41e504f4","analyzedAt":"2026-08-16T13:02:01.396Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}