[READ-ONLY] Mirror of https://github.com/bombshell-dev/tty. Platform independent 2D layout engine for terminal applications based on Clay
5

Configure Feed

Select the types of activity you want to include in your feed.

fix: leave terminal default foreground for uncolored text

Text with no explicit color was packed as concrete white
(0xFFFFFFFF), forcing white on light-background terminals. Encode
absent color as ATTR_DEFAULT (0x80 in the attrs byte) so the C path
skips the foreground SGR entirely, mirroring how an unset background
is already left alone.

Fixes #62

Nate Moore (Jun 5, 2026, 1:14 AM -0500) d9f71e20 ca558cbe

+6 -2
+6 -2
ops.ts
··· 202 202 case OP_TEXT: { 203 203 view.setUint32(o, OP_TEXT, true); 204 204 o += 4; 205 - view.setUint32(o, op.color ?? 0xFFFFFFFF, true); 205 + // No explicit color: leave the terminal default foreground by writing 206 + // 0 and setting ATTR_DEFAULT (0x80 in the attrs byte). The C path ORs 207 + // it into fg and emit_attr skips the foreground SGR (mirrors unset bg). 208 + let textDefault = op.color === undefined; 209 + view.setUint32(o, op.color ?? 0, true); 206 210 o += 4; 207 211 view.setUint32( 208 212 o, 209 213 (op.fontSize ?? 1) | 210 214 ((op.fontId ?? 0) << 8) | 211 215 ((op.wrap ?? 0) << 16) | 212 - ((op.attrs ?? 0) << 24), 216 + (((op.attrs ?? 0) | (textDefault ? 0x80 : 0)) << 24), 213 217 true, 214 218 ); 215 219 o += 4;