MCPcopy Create free account
hub / github.com/codeaashu/claude-code / shouldClearScreen

Function shouldClearScreen

src/ink/frame.ts:105–124  ·  view source on GitHub ↗
(
  prevFrame: Frame,
  frame: Frame,
)

Source from the content-addressed store, hash-verified

103 * 3. Previous frame screen height exceeded available terminal rows → 'offscreen'
104 */
105export function shouldClearScreen(
106 prevFrame: Frame,
107 frame: Frame,
108): FlickerReason | undefined {
109 const didResize =
110 frame.viewport.height !== prevFrame.viewport.height ||
111 frame.viewport.width !== prevFrame.viewport.width
112 if (didResize) {
113 return 'resize'
114 }
115
116 const currentFrameOverflows = frame.screen.height >= frame.viewport.height
117 const previousFrameOverflowed =
118 prevFrame.screen.height >= prevFrame.viewport.height
119 if (currentFrameOverflows || previousFrameOverflowed) {
120 return 'offscreen'
121 }
122
123 return undefined
124}
125

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected