| 336 | } |
| 337 | |
| 338 | function parsePaneMetrics(output: string): Omit<TmuxTraceFrame, 'label' | 'pane'> { |
| 339 | const [cursorX, cursorY, historySize, paneWidth, paneHeight] = output |
| 340 | .trim() |
| 341 | .split(',') |
| 342 | |
| 343 | if ( |
| 344 | cursorX === undefined || |
| 345 | cursorY === undefined || |
| 346 | historySize === undefined || |
| 347 | paneWidth === undefined || |
| 348 | paneHeight === undefined |
| 349 | ) { |
| 350 | throw new Error(`Unable to parse pane metrics: ${output}`) |
| 351 | } |
| 352 | |
| 353 | return { |
| 354 | cursorX: Number.parseInt(cursorX, 10), |
| 355 | cursorY: Number.parseInt(cursorY, 10), |
| 356 | historySize: Number.parseInt(historySize, 10), |
| 357 | paneWidth: Number.parseInt(paneWidth, 10), |
| 358 | paneHeight: Number.parseInt(paneHeight, 10), |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | export function capturePaneFrame( |
| 363 | session: IsolatedTmuxSession, |