diff --git a/packages/coding-agent/src/cli.ts b/packages/coding-agent/src/cli.ts index fea8044d7..e6e512f38 100755 --- a/packages/coding-agent/src/cli.ts +++ b/packages/coding-agent/src/cli.ts @@ -6,6 +6,14 @@ import { type CommandEntry, run } from "@oh-my-pi/pi-utils/cli"; import { APP_NAME, VERSION } from "./config"; +// Detect known Bun errata that cause TUI crashes (e.g. Bun.stringWidth mishandling OSC sequences). +if (Bun.stringWidth("\x1b[0m\x1b]8;;\x07") !== 0) { + process.stderr.write( + `error: Bun runtime errata detected (v${Bun.version}). Please update Bun: bun upgrade\n`, + ); + process.exit(1); +} + process.title = APP_NAME; const commands: CommandEntry[] = [