@@ -3317,10 +3317,20 @@ Fix all CI failures now by making the necessary changes.`
33173317
33183318 // Use script command to create pseudo-TTY for Ink compatibility
33193319 // Platform-specific script command syntax
3320- // Windows doesn't have script, fall back to direct command
3321- const scriptCmd = WIN32
3322- ? claudeCommand
3323- : `script -q /dev/null ${ claudeCommand } < "${ tmpFile } "`
3320+ let scriptCmd
3321+ if ( WIN32 ) {
3322+ // Try winpty (comes with Git for Windows)
3323+ const winptyCheck = await runCommandWithOutput ( 'where' , [ 'winpty' ] )
3324+ if ( winptyCheck . exitCode === 0 ) {
3325+ scriptCmd = `winpty ${ claudeCommand } < "${ tmpFile } "`
3326+ } else {
3327+ // No winpty, try direct (may fail with raw mode error)
3328+ scriptCmd = `${ claudeCommand } < "${ tmpFile } "`
3329+ }
3330+ } else {
3331+ // Unix/macOS: use script command
3332+ scriptCmd = `script -q /dev/null ${ claudeCommand } < "${ tmpFile } "`
3333+ }
33243334
33253335 const exitCode = await new Promise ( ( resolve , _reject ) => {
33263336 const child = spawn ( scriptCmd , [ ] , {
@@ -3535,10 +3545,20 @@ Fix the failure now by making the necessary changes.`
35353545
35363546 // Use script command to create pseudo-TTY for Ink compatibility
35373547 // Platform-specific script command syntax
3538- // Windows doesn't have script, fall back to direct command
3539- const scriptCmd = WIN32
3540- ? claudeCommand
3541- : `script -q /dev/null ${ claudeCommand } < "${ tmpFile } "`
3548+ let scriptCmd
3549+ if ( WIN32 ) {
3550+ // Try winpty (comes with Git for Windows)
3551+ const winptyCheck = await runCommandWithOutput ( 'where' , [ 'winpty' ] )
3552+ if ( winptyCheck . exitCode === 0 ) {
3553+ scriptCmd = `winpty ${ claudeCommand } < "${ tmpFile } "`
3554+ } else {
3555+ // No winpty, try direct (may fail with raw mode error)
3556+ scriptCmd = `${ claudeCommand } < "${ tmpFile } "`
3557+ }
3558+ } else {
3559+ // Unix/macOS: use script command
3560+ scriptCmd = `script -q /dev/null ${ claudeCommand } < "${ tmpFile } "`
3561+ }
35423562
35433563 const exitCode = await new Promise ( ( resolve , _reject ) => {
35443564 const child = spawn ( scriptCmd , [ ] , {
0 commit comments