Commit 029c82f1837a

Vincent Demeester <vincent@sbr.pm>
2026-02-18 14:14:23
fix(dots): use foreground-only ANSI reset for hex colors
Changed from \x1b[0m (full reset) to \x1b[39m (foreground only) to match pi's theme.fg() behavior. Full reset was breaking the TUI's background and formatting stack.
1 parent 06c3e2a
Changed files (2)
dots
dots/pi/agent/extensions/custom-footer.ts
@@ -239,7 +239,7 @@ function hexToAnsi(hex: string): string {
 function getModeText(modeName: string, hexColor: string | undefined, theme: any): string {
 	const label = `[${modeName}]`;
 	if (hexColor && /^#[0-9a-fA-F]{6}$/.test(hexColor)) {
-		return `${hexToAnsi(hexColor)}${label}\x1b[0m`;
+		return `${hexToAnsi(hexColor)}${label}\x1b[39m`;
 	}
 	return theme.fg("dim", label);
 }
dots/pi/agent/extensions/prompt-editor.ts
@@ -350,7 +350,7 @@ function getModeBorderColor(ctx: ExtensionContext, pi: ExtensionAPI, mode: strin
 	// Hex color from modes.json
 	if (spec?.color && /^#[0-9a-fA-F]{6}$/.test(spec.color)) {
 		const ansi = hexToAnsi(spec.color);
-		return (text: string) => `${ansi}${text}\x1b[0m`;
+		return (text: string) => `${ansi}${text}\x1b[39m`;
 	}
 
 	// Theme token fallback