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

Function identifySequence

src/ink/termio/parser.ts:245–256  ·  view source on GitHub ↗

* Identify the type of escape sequence from its raw form.

(
  seq: string,
)

Source from the content-addressed store, hash-verified

243 * Identify the type of escape sequence from its raw form.
244 */
245function identifySequence(
246 seq: string,
247): 'csi' | 'osc' | 'esc' | 'ss3' | 'unknown' {
248 if (seq.length < 2) return 'unknown'
249 if (seq.charCodeAt(0) !== C0.ESC) return 'unknown'
250
251 const second = seq.charCodeAt(1)
252 if (second === 0x5b) return 'csi' // [
253 if (second === 0x5d) return 'osc' // ]
254 if (second === 0x4f) return 'ss3' // O
255 return 'esc'
256}
257
258// =============================================================================
259// Main Parser

Callers 1

processSequenceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected