fix: size main pane using configured layout percentage
Main pane resize now uses main_pane_size instead of a hardcoded 50 percent fallback so post-split layout remains stable and predictable. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -29,13 +29,15 @@ export async function applyLayout(
|
||||
export async function enforceMainPaneWidth(
|
||||
mainPaneId: string,
|
||||
windowWidth: number,
|
||||
mainPaneSize: number,
|
||||
): Promise<void> {
|
||||
const { log } = await import("../../logger")
|
||||
const tmux = await getTmuxPath()
|
||||
if (!tmux) return
|
||||
|
||||
const dividerWidth = 1
|
||||
const mainWidth = Math.floor((windowWidth - dividerWidth) / 2)
|
||||
const boundedMainPaneSize = Math.max(20, Math.min(80, mainPaneSize))
|
||||
const mainWidth = Math.floor(((windowWidth - dividerWidth) * boundedMainPaneSize) / 100)
|
||||
|
||||
const proc = spawn([tmux, "resize-pane", "-t", mainPaneId, "-x", String(mainWidth)], {
|
||||
stdout: "ignore",
|
||||
@@ -47,5 +49,6 @@ export async function enforceMainPaneWidth(
|
||||
mainPaneId,
|
||||
mainWidth,
|
||||
windowWidth,
|
||||
mainPaneSize: boundedMainPaneSize,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user