@ekkos/cli 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/run.js +33 -12
- package/package.json +1 -1
package/dist/commands/run.js
CHANGED
|
@@ -731,9 +731,9 @@ async function runWithSpawn(claudePath, args, options, state) {
|
|
|
731
731
|
console.log('');
|
|
732
732
|
let claude;
|
|
733
733
|
if (isWindows) {
|
|
734
|
-
// On Windows, spawn
|
|
735
|
-
//
|
|
736
|
-
//
|
|
734
|
+
// On Windows, Node.js spawn doesn't provide proper TTY support
|
|
735
|
+
// Claude Code detects non-TTY and defaults to --print mode
|
|
736
|
+
// Solution: Use cmd.exe /c to run claude directly with proper console
|
|
737
737
|
if (claudePath === 'npx') {
|
|
738
738
|
console.log('');
|
|
739
739
|
console.log(chalk_1.default.red('═══════════════════════════════════════════════════════════════════'));
|
|
@@ -746,18 +746,39 @@ async function runWithSpawn(claudePath, args, options, state) {
|
|
|
746
746
|
console.log(chalk_1.default.yellow(' Then try again:'));
|
|
747
747
|
console.log(chalk_1.default.cyan(' ekkos run -b'));
|
|
748
748
|
console.log('');
|
|
749
|
-
|
|
750
|
-
|
|
749
|
+
process.exit(1);
|
|
750
|
+
}
|
|
751
|
+
console.log(chalk_1.default.gray('Windows mode: launching Claude with proper TTY...'));
|
|
752
|
+
// Build the full command
|
|
753
|
+
const fullCmd = args.length > 0
|
|
754
|
+
? `"${claudePath}" ${args.join(' ')}`
|
|
755
|
+
: `"${claudePath}"`;
|
|
756
|
+
// Use cmd.exe /c to get proper console behavior
|
|
757
|
+
// This replaces the current process with claude
|
|
758
|
+
const { spawnSync } = require('child_process');
|
|
759
|
+
// First try: Direct exec replacement
|
|
760
|
+
try {
|
|
761
|
+
const result = spawnSync('cmd.exe', ['/c', fullCmd], {
|
|
762
|
+
stdio: 'inherit',
|
|
763
|
+
cwd: process.cwd(),
|
|
764
|
+
env: process.env,
|
|
765
|
+
windowsHide: false,
|
|
766
|
+
shell: false
|
|
767
|
+
});
|
|
768
|
+
// If we get here, claude exited
|
|
769
|
+
(0, state_1.clearAutoClearFlag)();
|
|
770
|
+
process.exit(result.status || 0);
|
|
771
|
+
}
|
|
772
|
+
catch (err) {
|
|
773
|
+
console.error(chalk_1.default.red('Failed to launch Claude:'), err.message);
|
|
774
|
+
console.log('');
|
|
775
|
+
console.log(chalk_1.default.yellow('Try running claude directly:'));
|
|
776
|
+
console.log(chalk_1.default.cyan(' claude'));
|
|
751
777
|
console.log('');
|
|
752
778
|
process.exit(1);
|
|
753
779
|
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
stdio: 'inherit', // Full inherit for proper interactive mode
|
|
757
|
-
cwd: process.cwd(),
|
|
758
|
-
env: process.env,
|
|
759
|
-
shell: true
|
|
760
|
-
});
|
|
780
|
+
// This line won't be reached due to spawnSync + process.exit
|
|
781
|
+
return;
|
|
761
782
|
}
|
|
762
783
|
else {
|
|
763
784
|
// Use script command for PTY on Unix
|