fix: show correct version in startup screen

StartupScreen.ts was reading the version via globalThis['MACRO_DISPLAY_VERSION']
which is never populated — the Bun bundler inlines it as MACRO.DISPLAY_VERSION
(dot notation), not as a globalThis key.

Result: startup screen always showed the hardcoded fallback 'v0.1.4' regardless
of the installed version.

Fix: use MACRO.DISPLAY_VERSION ?? MACRO.VERSION directly, consistent with
cli.tsx, main.tsx, and logoV2Utils.ts.

Fixes #95

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
gnanam1990
2026-04-02 09:05:00 +05:30
parent cb8973e99b
commit 8c6a10517f

View File

@@ -5,6 +5,8 @@
* Addresses: https://github.com/Gitlawb/openclaude/issues/55 * Addresses: https://github.com/Gitlawb/openclaude/issues/55
*/ */
declare const MACRO: { VERSION: string; DISPLAY_VERSION?: string }
const ESC = '\x1b[' const ESC = '\x1b['
const RESET = `${ESC}0m` const RESET = `${ESC}0m`
const DIM = `${ESC}2m` const DIM = `${ESC}2m`
@@ -172,7 +174,7 @@ export function printStartupScreen(): void {
out.push(boxRow(sRow, W, sLen)) out.push(boxRow(sRow, W, sLen))
out.push(`${rgb(...BORDER)}\u255a${'\u2550'.repeat(W - 2)}\u255d${RESET}`) out.push(`${rgb(...BORDER)}\u255a${'\u2550'.repeat(W - 2)}\u255d${RESET}`)
out.push(` ${DIM}${rgb(...DIMCOL)}openclaude v${(globalThis as Record<string, unknown>)['MACRO_DISPLAY_VERSION'] ?? '0.1.4'}${RESET}`) out.push(` ${DIM}${rgb(...DIMCOL)}openclaude v${MACRO.DISPLAY_VERSION ?? MACRO.VERSION}${RESET}`)
out.push('') out.push('')
process.stdout.write(out.join('\n') + '\n') process.stdout.write(out.join('\n') + '\n')