diff --git a/src/utils/terminal.ts b/src/utils/terminal.ts index 394f5e3..ddc5919 100644 --- a/src/utils/terminal.ts +++ b/src/utils/terminal.ts @@ -34,6 +34,12 @@ export function getPackageVersion(): string { // Get terminal width export function getTerminalWidth(): number | null { + // Preserve historical behavior on Windows: width detection is unavailable. + // This avoids Unix fallback command behavior (e.g. 2>/dev/null) on Windows. + if (process.platform === 'win32') { + return null; + } + try { // First try to get the tty of the parent process const tty = execSync('ps -o tty= -p $(ps -o ppid= -p $$)', { @@ -83,6 +89,11 @@ export function getTerminalWidth(): number | null { // Check if terminal width detection is available export function canDetectTerminalWidth(): boolean { + // Preserve historical behavior on Windows: width detection is unavailable. + if (process.platform === 'win32') { + return false; + } + try { // First try to get the tty of the parent process const tty = execSync('ps -o tty= -p $(ps -o ppid= -p $$)', { @@ -123,4 +134,4 @@ export function canDetectTerminalWidth(): boolean { } catch { return false; } -} \ No newline at end of file +}