fix(tmux): stop layout override after spawn, use configured main pane size

Remove applyLayout(select-layout main-vertical) call after spawn which
was destroying grid arrangements by forcing vertical stacking. Now only
enforceMainPaneWidth is called, preserving the grid created by manual
split directions. Also fix enforceMainPaneWidth to use config's
main_pane_size percentage instead of hardcoded 50%.
This commit is contained in:
YeonGyu-Kim
2026-02-17 04:10:35 +09:00
parent 34f212c2cb
commit 6abe98fb4c
2 changed files with 2 additions and 4 deletions
@@ -72,7 +72,6 @@ export async function executeActionWithDeps(
)
if (result.success) {
await deps.applyLayout(ctx.config.layout, ctx.config.main_pane_size)
await enforceMainPane(ctx.windowState, ctx.config, deps)
}
@@ -66,7 +66,7 @@ describe("executeAction", () => {
mockSpawnTmuxPane.mockImplementation(async () => ({ success: true, paneId: "%7" }))
})
test("applies configured tmux layout after successful spawn", async () => {
test("enforces main pane width with configured percentage after successful spawn", async () => {
// given
// when
const result = await executeActionWithDeps(
@@ -83,8 +83,7 @@ describe("executeAction", () => {
// then
expect(result).toEqual({ success: true, paneId: "%7" })
expect(mockApplyLayout).toHaveBeenCalledTimes(1)
expect(mockApplyLayout).toHaveBeenCalledWith("main-horizontal", 55)
expect(mockApplyLayout).not.toHaveBeenCalled()
expect(mockEnforceMainPaneWidth).toHaveBeenCalledTimes(1)
expect(mockEnforceMainPaneWidth).toHaveBeenCalledWith("%0", 220, 55)
})