MCPcopy Index your code
hub / github.com/codeaashu/claude-code / tabStatus

Function tabStatus

src/ink/termio/osc.ts:476–493  ·  view source on GitHub ↗
(fields: TabStatusAction)

Source from the content-addressed store, hash-verified

474 * `;` and `\` in status text are escaped per the spec.
475 */
476export function tabStatus(fields: TabStatusAction): string {
477 const parts: string[] = []
478 const rgb = (c: Color) =>
479 c.type === 'rgb'
480 ? `#${[c.r, c.g, c.b].map(n => n.toString(16).padStart(2, '0')).join('')}`
481 : ''
482 if ('indicator' in fields)
483 parts.push(`indicator=${fields.indicator ? rgb(fields.indicator) : ''}`)
484 if ('status' in fields)
485 parts.push(
486 `status=${fields.status?.replaceAll('\\', '\\\\').replaceAll(';', '\\;') ?? ''}`,
487 )
488 if ('statusColor' in fields)
489 parts.push(
490 `status-color=${fields.statusColor ? rgb(fields.statusColor) : ''}`,
491 )
492 return osc(OSC.TAB_STATUS, parts.join(';'))
493}
494

Callers 1

useTabStatusFunction · 0.85

Calls 3

oscFunction · 0.85
rgbFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected