{"record":{"id":"6a9d3cb63c7796ac","repo":"wezterm/wezterm","slug":"no-space-for-split","errorCode":null,"errorMessage":"No space for split!","messagePattern":"No space for split!","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"mux/src/tab.rs","lineNumber":1994,"sourceCode":"\n            let tab_size = self.size;\n            if split_info.first.rows == 0\n                || split_info.first.cols == 0\n                || split_info.second.rows == 0\n                || split_info.second.cols == 0\n                || split_info.top_of_second() + split_info.second.rows > tab_size.rows\n                || split_info.left_of_second() + split_info.second.cols > tab_size.cols\n            {\n                log::error!(\n                    \"No space for split!!! {:#?} height={} width={} top_of_second={} left_of_second={} tab_size={:?}\",\n                    split_info,\n                    split_info.height(),\n                    split_info.width(),\n                    split_info.top_of_second(),\n                    split_info.left_of_second(),\n                    tab_size\n                );\n                anyhow::bail!(\"No space for split!\");\n            }\n\n            let needs_resize = if request.top_level {\n                self.pane.as_ref().unwrap().num_leaves() > 1\n            } else {\n                false\n            };\n\n            if needs_resize {\n                // Pre-emptively resize the tab contents down to\n                // match the target size; it's easier to reuse\n                // existing resize logic that way\n                if request.target_is_second {\n                    self.resize(split_info.first.clone());\n                } else {\n                    self.resize(split_info.second.clone());\n                }\n            }","sourceCodeStart":1976,"sourceCodeEnd":2012,"githubUrl":"https://github.com/wezterm/wezterm/blob/9c04f79f86649f76a8c978ff4b674f60297a6ec9/mux/src/tab.rs#L1976-L2012","documentation":"Returned by Tab::split_and_insert (mux/src/tab.rs:1994) when the computed split geometry is degenerate: either half would have 0 rows or 0 cols, or the second half would overflow past the tab's total size. It logs full diagnostics (split_info, dimensions, tab size) before bailing. In practice the tab is simply too small for another split at the current font size: there are not enough cells to give both halves a nonzero size.","triggerScenarios":"Splitting repeatedly until a region is one row/col tall or narrow; a very small window; a very large font size relative to window size; a default/computed cell dimension making split_dimension round one half down to zero.","commonSituations":"Tiny floating windows or minimal splits tiled by a window manager; huge fonts for accessibility; auto-split scripts that do not check remaining space; shrinking the window after many splits.","solutions":["Increase the window size (or close some panes) so the region has at least ~2 rows/cols in the split direction, then retry","Reduce the font size for that window so more cells fit","In automation, check the target pane's rows/cols (PositionedPane from iter_panes) and skip the split when the relevant dimension < 2"],"exampleFix":"// before\ntab.split_and_insert(idx, request, pane)?;\n\n// after: only split when there is room\nlet panes = tab.iter_panes();\nlet room = panes.get(idx).map(|p| match request.direction {\n    SplitDirection::Vertical => p.height > 1,\n    SplitDirection::Horizontal => p.width > 1,\n}).unwrap_or(false);\nif room {\n    tab.split_and_insert(idx, request, pane)?;\n}","handlingStrategy":"validation","validationCode":"// Only split regions with at least 2 cells in the split direction\nlet panes = tab.iter_panes();\nlet fits = panes.get(pane_index).is_some_and(|p| match request.direction {\n    SplitDirection::Vertical => p.height >= 2,\n    SplitDirection::Horizontal => p.width >= 2,\n});\nif fits {\n    tab.split_and_insert(pane_index, request, pane)?;\n}","typeGuard":"fn region_can_split(tab: &Tab, pane_index: usize, direction: SplitDirection) -> bool {\n    tab.iter_panes().get(pane_index).is_some_and(|p| match direction {\n        SplitDirection::Vertical => p.height >= 2,\n        SplitDirection::Horizontal => p.width >= 2,\n    })\n}","tryCatchPattern":"match tab.split_and_insert(pane_index, request, pane) {\n    Ok(i) => i,\n    Err(err) if err.to_string() == \"No space for split!\" => {\n        // enlarge the window or close a pane, then retry; or skip silently\n        return Ok(/* current index */ pane_index);\n    }\n    Err(err) => return Err(err),\n}","preventionTips":["Cap the number of splits per tab and stop when the region is 1 row/col in the split direction","Check PositionedPane dimensions from iter_panes() before splitting in automation","Remember font size trades against splittable space in small windows"],"tags":["mux","tab","split","terminal-too-small","layout","rust","wezterm"],"backgroundTag":"terminal-too-small","analyzedSha":"9c04f79f86649f76a8c978ff4b674f60297a6ec9","analyzedAt":"2026-08-16T21:23:27.157Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}