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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user