{"record":{"id":"b58dce4d3b6372ff","repo":"LGUG2Z/komorebi","slug":"there-is-only-one-window-in-this-container","errorCode":null,"errorMessage":"there is only one window in this container","messagePattern":"there is only one window in this container","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"komorebi/src/window_manager.rs","lineNumber":2688,"sourceCode":"        &mut self,\n        direction: CycleDirection,\n    ) -> eyre::Result<()> {\n        self.handle_unmanaged_window_behaviour()?;\n\n        tracing::info!(\"cycling container windows\");\n\n        let container =\n            if let Some(container) = &mut self.focused_workspace_mut()?.monocle_container {\n                container\n            } else {\n                self.focused_container_mut()?\n            };\n\n        let len = NonZeroUsize::new(container.windows().len())\n            .ok_or_eyre(\"there must be at least one window in a container\")?;\n\n        if len.get() == 1 {\n            bail!(\"there is only one window in this container\");\n        }\n\n        let current_idx = container.focused_window_idx();\n        let next_idx = direction.next_idx(current_idx, len);\n\n        container.focus_window(next_idx);\n        container.load_focused_window();\n\n        if let Some(window) = container.focused_window() {\n            window.focus(self.mouse_follows_focus)?;\n        }\n\n        self.update_focused_workspace(self.mouse_follows_focus, true)\n    }\n\n    #[tracing::instrument(skip(self))]\n    pub fn cycle_container_window_index_in_direction(\n        &mut self,","sourceCodeStart":2670,"sourceCodeEnd":2706,"githubUrl":"https://github.com/LGUG2Z/komorebi/blob/e0709f02bfae4e503bf4640f58ee75ecbbfdbb97/komorebi/src/window_manager.rs#L2670-L2706","documentation":"cycle_container_window_in_direction cycles which window inside a container receives focus, and requires at least two windows to cycle meaningfully. If the focused container holds exactly one window there is nothing to cycle to, so komorebi throws instead of silently wrapping focus onto itself.","triggerScenarios":"Calling cycle_container_window_in_direction (komorebic cycle-focus / stack cycling keybinds) when container.windows().len() == 1 — a single window with no stack partners in the focused container.","commonSituations":"Binding cycle-window hotkeys globally and pressing them on any tiled window (most containers hold one window unless the user stacks/crops windows into a container); misuse of container stacking features.","solutions":["Press the hotkey only on containers with stacked windows (multiple windows in one container cell)","Stack another window into the container first (komorebic stack) to enable cycling","Configure the keybind to cycle workspace windows instead of container windows if single-window containers are common","Swallow this expected error in hotkey dispatch code"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// only cycle when container has >1 window\nlet count = query_focused_container_window_count();\nif count > 1 { komorebic cycle-focus /* ... */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stack windows into a container before using container-window cycling","Bind cycle hotkeys to no-op when only one window is stacked","Prefer workspace-level focus cycling for general navigation"],"tags":["windows","window-manager","container","stack"],"backgroundTag":"operation-not-supported","analyzedSha":"e0709f02bfae4e503bf4640f58ee75ecbbfdbb97","analyzedAt":"2026-09-06T07:08:05.107Z","contentChangedAt":"2026-09-06T07:08:05.107Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}