MCPcopy Create free account
hub / github.com/freecodexyz/free-code / isOutputLineTruncated

Function isOutputLineTruncated

src/utils/terminal.ts:119–131  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

117 * very long line that wraps past 3 visual rows — acceptable, since the common
118 * case is multi-line output. */
119export function isOutputLineTruncated(content: string): boolean {
120 let pos = 0
121 // Need more than MAX_LINES_TO_SHOW newlines (content fills > 3 lines).
122 // The +1 accounts for wrapText showing an extra line when remainingLines==1.
123 for (let i = 0; i <= MAX_LINES_TO_SHOW; i++) {
124 pos = content.indexOf('\n', pos)
125 if (pos === -1) return false
126 pos++
127 }
128 // A trailing newline is a terminator, not a new line — match
129 // renderTruncatedContent's trimEnd() behavior.
130 return pos < content.length
131}

Callers 5

isResultTruncatedFunction · 0.85
isResultTruncatedFunction · 0.85
isResultTruncatedFunction · 0.85
isResultTruncatedFunction · 0.85
isResultTruncatedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected