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

Function asTerminalEscaped

src/native-ts/color-diff/index.ts:147–162  ·  view source on GitHub ↗
(
  blocks: readonly Block[],
  mode: ColorMode,
  skipBackground: boolean,
  dim: boolean,
)

Source from the content-addressed store, hash-verified

145}
146
147function asTerminalEscaped(
148 blocks: readonly Block[],
149 mode: ColorMode,
150 skipBackground: boolean,
151 dim: boolean,
152): string {
153 let out = dim ? RESET + DIM : RESET
154 for (const [style, text] of blocks) {
155 out += colorToEscape(style.foreground, true, mode)
156 if (!skipBackground) {
157 out += colorToEscape(style.background, false, mode)
158 }
159 out += text
160 }
161 return out + RESET
162}
163
164// ---------------------------------------------------------------------------
165// Theme

Callers 1

intoLinesFunction · 0.85

Calls 1

colorToEscapeFunction · 0.85

Tested by

no test coverage detected