diff --git a/src/features/tmux-subagent/pane-state-querier.ts b/src/features/tmux-subagent/pane-state-querier.ts index 2c581163d..005e31672 100644 --- a/src/features/tmux-subagent/pane-state-querier.ts +++ b/src/features/tmux-subagent/pane-state-querier.ts @@ -1,5 +1,6 @@ import { spawn } from "bun" import type { WindowState, TmuxPaneInfo } from "./types" +import { parsePaneStateOutput } from "./pane-state-parser" import { getTmuxPath } from "../../tools/interactive-bash/tmux-path-resolver" import { log } from "../../shared" @@ -27,31 +28,12 @@ export async function queryWindowState(sourcePaneId: string): Promise 8 ? fields.slice(8).join("\t") : "" - const width = parseInt(widthStr, 10) - const height = parseInt(heightStr, 10) - const left = parseInt(leftStr, 10) - const top = parseInt(topStr, 10) - const isActive = activeStr === "1" - windowWidth = parseInt(windowWidthStr, 10) - windowHeight = parseInt(windowHeightStr, 10) - - if (!isNaN(width) && !isNaN(left) && !isNaN(height) && !isNaN(top)) { - panes.push({ paneId, width, height, left, top, title, isActive }) - } - } + const { panes } = parsedPaneState + const windowWidth = parsedPaneState.windowWidth + const windowHeight = parsedPaneState.windowHeight panes.sort((a, b) => a.left - b.left || a.top - b.top)