diff --git a/src/cliproxy/auth-handler.ts b/src/cliproxy/auth-handler.ts index eb027268..4a192c33 100644 --- a/src/cliproxy/auth-handler.ts +++ b/src/cliproxy/auth-handler.ts @@ -94,8 +94,10 @@ function isHeadlessEnvironment(): boolean { return true; } - // Non-interactive (piped stdin) - if (!process.stdin.isTTY) { + // Non-interactive (piped stdin) - skip on Windows + // Windows npm wrappers don't set isTTY correctly (returns undefined, not true) + // Windows desktop environments always have browser capability + if (process.platform !== 'win32' && !process.stdin.isTTY) { return true; } diff --git a/src/commands/help-command.ts b/src/commands/help-command.ts index edac032a..8c065226 100644 --- a/src/commands/help-command.ts +++ b/src/commands/help-command.ts @@ -1,7 +1,11 @@ +import * as fs from 'fs'; +import * as path from 'path'; import { initUI, box, color, dim, sectionHeader, subheader } from '../utils/ui'; -// Version is read from VERSION file during build -const VERSION = '5.3.0'; +// Get version from package.json (same as version-command.ts) +const VERSION = JSON.parse( + fs.readFileSync(path.join(__dirname, '../../package.json'), 'utf8') +).version; /** * Print a major section with ═══ borders (only for 3 main sections)