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

Function splitTabStatusPairs

src/ink/termio/osc.ts:368–394  ·  view source on GitHub ↗

Split `k=v;k=v` honoring `\;` and `\\` escapes. Yields [key, unescapedValue].

(data: string)

Source from the content-addressed store, hash-verified

366
367/** Split `k=v;k=v` honoring `\;` and `\\` escapes. Yields [key, unescapedValue]. */
368function* splitTabStatusPairs(data: string): Generator<[string, string]> {
369 let key = ''
370 let val = ''
371 let inVal = false
372 let esc = false
373 for (const c of data) {
374 if (esc) {
375 if (inVal) val += c
376 else key += c
377 esc = false
378 } else if (c === '\\') {
379 esc = true
380 } else if (c === ';') {
381 yield [key, val]
382 key = ''
383 val = ''
384 inVal = false
385 } else if (c === '=' && !inVal) {
386 inVal = true
387 } else if (inVal) {
388 val += c
389 } else {
390 key += c
391 }
392 }
393 if (key || inVal) yield [key, val]
394}
395
396// Output generators
397

Callers 1

parseTabStatusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected