wezterm/wezterm · warning

No space for split!

Error message

No space for split!

What it means

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.

Source

Thrown at mux/src/tab.rs:1994

            let tab_size = self.size;
            if split_info.first.rows == 0
                || split_info.first.cols == 0
                || split_info.second.rows == 0
                || split_info.second.cols == 0
                || split_info.top_of_second() + split_info.second.rows > tab_size.rows
                || split_info.left_of_second() + split_info.second.cols > tab_size.cols
            {
                log::error!(
                    "No space for split!!! {:#?} height={} width={} top_of_second={} left_of_second={} tab_size={:?}",
                    split_info,
                    split_info.height(),
                    split_info.width(),
                    split_info.top_of_second(),
                    split_info.left_of_second(),
                    tab_size
                );
                anyhow::bail!("No space for split!");
            }

            let needs_resize = if request.top_level {
                self.pane.as_ref().unwrap().num_leaves() > 1
            } else {
                false
            };

            if needs_resize {
                // Pre-emptively resize the tab contents down to
                // match the target size; it's easier to reuse
                // existing resize logic that way
                if request.target_is_second {
                    self.resize(split_info.first.clone());
                } else {
                    self.resize(split_info.second.clone());
                }
            }

View on GitHub (pinned to 9c04f79f86)

Solutions

  1. Increase the window size (or close some panes) so the region has at least ~2 rows/cols in the split direction, then retry
  2. Reduce the font size for that window so more cells fit
  3. In automation, check the target pane's rows/cols (PositionedPane from iter_panes) and skip the split when the relevant dimension < 2

Example fix

// before
tab.split_and_insert(idx, request, pane)?;

// after: only split when there is room
let panes = tab.iter_panes();
let room = panes.get(idx).map(|p| match request.direction {
    SplitDirection::Vertical => p.height > 1,
    SplitDirection::Horizontal => p.width > 1,
}).unwrap_or(false);
if room {
    tab.split_and_insert(idx, request, pane)?;
}
Defensive patterns

Strategy: validation

Validate before calling

// Only split regions with at least 2 cells in the split direction
let panes = tab.iter_panes();
let fits = panes.get(pane_index).is_some_and(|p| match request.direction {
    SplitDirection::Vertical => p.height >= 2,
    SplitDirection::Horizontal => p.width >= 2,
});
if fits {
    tab.split_and_insert(pane_index, request, pane)?;
}

Type guard

fn region_can_split(tab: &Tab, pane_index: usize, direction: SplitDirection) -> bool {
    tab.iter_panes().get(pane_index).is_some_and(|p| match direction {
        SplitDirection::Vertical => p.height >= 2,
        SplitDirection::Horizontal => p.width >= 2,
    })
}

Try / catch

match tab.split_and_insert(pane_index, request, pane) {
    Ok(i) => i,
    Err(err) if err.to_string() == "No space for split!" => {
        // enlarge the window or close a pane, then retry; or skip silently
        return Ok(/* current index */ pane_index);
    }
    Err(err) => return Err(err),
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of wezterm/wezterm@9c04f79f86 (2026-08-16). Data as JSON: /api/errors/6a9d3cb63c7796ac. Report an issue: GitHub.