File tree Expand file tree Collapse file tree 3 files changed +28
-14
lines changed
Expand file tree Collapse file tree 3 files changed +28
-14
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,24 @@ const { program } = require('commander');
22const path = require ( 'node:path' ) ;
33const fs = require ( 'node:fs' ) ;
44
5+ // Fix for stdin issues when running through npm on Windows
6+ // Ensures keyboard interaction works properly with inquirer prompts
7+ if ( process . stdin . isTTY ) {
8+ try {
9+ process . stdin . resume ( ) ;
10+ process . stdin . setEncoding ( 'utf8' ) ;
11+
12+ // On Windows, explicitly reference the stdin stream to ensure it's properly initialized
13+ if ( process . platform === 'win32' ) {
14+ process . stdin . on ( 'error' , ( ) => {
15+ // Ignore stdin errors - they can occur when the terminal is closing
16+ } ) ;
17+ }
18+ } catch {
19+ // Silently ignore - some environments may not support these operations
20+ }
21+ }
22+
523// Load package.json from root for version info
624const packageJson = require ( '../../package.json' ) ;
725
Original file line number Diff line number Diff line change 11const chalk = require ( 'chalk' ) ;
22const path = require ( 'node:path' ) ;
3+ const inquirer = require ( 'inquirer' ) ;
34const { Installer } = require ( '../installers/lib/core/installer' ) ;
45const { UI } = require ( '../lib/ui' ) ;
56
@@ -65,18 +66,13 @@ module.exports = {
6566 console . log ( chalk . dim ( ' • ElevenLabs AI (150+ premium voices)' ) ) ;
6667 console . log ( chalk . dim ( ' • Piper TTS (50+ free voices)\n' ) ) ;
6768
68- const readline = require ( 'node:readline' ) ;
69- const rl = readline . createInterface ( {
70- input : process . stdin ,
71- output : process . stdout ,
72- } ) ;
73-
74- await new Promise ( ( resolve ) => {
75- rl . question ( chalk . green ( 'Press Enter to start AgentVibes installer...' ) , ( ) => {
76- rl . close ( ) ;
77- resolve ( ) ;
78- } ) ;
79- } ) ;
69+ await inquirer . prompt ( [
70+ {
71+ type : 'input' ,
72+ name : 'continue' ,
73+ message : chalk . green ( 'Press Enter to start AgentVibes installer...' ) ,
74+ } ,
75+ ] ) ;
8076
8177 console . log ( '' ) ;
8278
You can’t perform that action at this time.
0 commit comments