MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / consumeCellSizeResponse

Method consumeCellSizeResponse

packages/pi-tui/src/tui.ts:883–901  ·  view source on GitHub ↗
(data: string)

Source from the content-addressed store, hash-verified

881 }
882
883 private consumeCellSizeResponse(data: string): boolean {
884 // Response format: ESC [ 6 ; height ; width t
885 const match = data.match(/^\x1b\[6;(\d+);(\d+)t$/);
886 if (!match) {
887 return false;
888 }
889
890 const heightPx = parseInt(match[1]!, 10);
891 const widthPx = parseInt(match[2]!, 10);
892 if (heightPx <= 0 || widthPx <= 0) {
893 return true;
894 }
895
896 setCellDimensions({ widthPx, heightPx });
897 // Invalidate all components so images re-render with correct dimensions.
898 this.invalidate();
899 this.requestRender();
900 return true;
901 }
902
903 /**
904 * Resolve overlay layout from options.

Callers 1

handleInputMethod · 0.95

Calls 3

invalidateMethod · 0.95
requestRenderMethod · 0.95
setCellDimensionsFunction · 0.90

Tested by

no test coverage detected