fix(tmux): use actual pane dimensions and configured min width for grid calculation

Agent area width now uses real mainPane.width instead of hardcoded 50%
ratio. Grid planning, split availability, and spawn target finding now
respect user's agent_pane_min_width config instead of hardcoded
MIN_PANE_WIDTH=52, enabling 2-column grid layouts on narrower terminals.
This commit is contained in:
YeonGyu-Kim
2026-02-17 04:10:27 +09:00
parent 219c1f8225
commit b3c5f4caf5
5 changed files with 112 additions and 10 deletions
@@ -5,7 +5,7 @@ import type {
TmuxPaneInfo,
WindowState,
} from "./types"
import { MAIN_PANE_RATIO } from "./tmux-grid-constants"
import { DIVIDER_SIZE } from "./tmux-grid-constants"
import {
canSplitPane,
findMinimalEvictions,
@@ -26,7 +26,10 @@ export function decideSpawnActions(
}
const minPaneWidth = config.agentPaneWidth
const agentAreaWidth = Math.floor(state.windowWidth * (1 - MAIN_PANE_RATIO))
const agentAreaWidth = Math.max(
0,
state.windowWidth - state.mainPane.width - DIVIDER_SIZE,
)
const currentCount = state.agentPanes.length
if (agentAreaWidth < minPaneWidth) {