fix: bun string encoding (#746)

This commit is contained in:
Kainoa Kanter
2026-01-29 16:51:21 -08:00
committed by GitHub
parent 841036c294
commit 160e0123f5
2 changed files with 18 additions and 2 deletions

View File

@@ -2,6 +2,17 @@ import { Text } from "ink";
import { useEffect, useState } from "react";
import { colors } from "./colors";
function fixBunEncoding(text: string): string {
if (typeof Bun === "undefined") return text;
// Replace literal characters with Unicode codepoints
return text
.replace(/█/g, String.fromCharCode(0x2588)) // Full block
.replace(/▓/g, String.fromCharCode(0x2593)) // Dark shade
.replace(/▒/g, String.fromCharCode(0x2592)) // Medium shade
.replace(/░/g, String.fromCharCode(0x2591)); // Light shade
}
// Define animation frames - 3D rotation effect with gradient (█ → ▓ → ▒ → ░)
// Each frame is ~10 chars wide, 5 lines tall - matches login dialog asciiLogo size
const logoFrames = [
@@ -89,7 +100,7 @@ const logoFrames = [
█▓ █▓ █▓
█▓ █▓
█████▓ `,
];
].map(fixBunEncoding);
interface AnimatedLogoProps {
color?: string;