@@ -294,7 +294,7 @@ export async function renderSelectPrompt<T>(
294294 { renderOptions, isConfirmationPrompt, ...props } : RenderSelectPromptOptions < T > ,
295295 uiDebugOptions : UIDebugOptions = defaultUIDebugOptions ,
296296) : Promise < T > {
297- throwInNonTTY ( { message : props . message , stdin : renderOptions ?. stdin , stdout : renderOptions ?. stdout } , uiDebugOptions )
297+ throwInNonTTY ( { message : props . message , stdin : renderOptions ?. stdin } , uiDebugOptions )
298298
299299 return runWithTimer ( 'cmd_all_timing_prompts_ms' ) ( async ( ) => {
300300 let selectedValue : T
@@ -429,7 +429,7 @@ export async function renderAutocompletePrompt<T>(
429429 { renderOptions, ...props } : RenderAutocompleteOptions < T > ,
430430 uiDebugOptions : UIDebugOptions = defaultUIDebugOptions ,
431431) : Promise < T > {
432- throwInNonTTY ( { message : props . message , stdin : renderOptions ?. stdin , stdout : renderOptions ?. stdout } , uiDebugOptions )
432+ throwInNonTTY ( { message : props . message , stdin : renderOptions ?. stdin } , uiDebugOptions )
433433
434434 // The default search filters in-memory choices synchronously, so it doesn't need
435435 // throttling. Skipping the throttle makes the keystroke-to-result latency feel
@@ -666,7 +666,7 @@ export async function renderTextPrompt(
666666 { renderOptions, ...props } : RenderTextPromptOptions ,
667667 uiDebugOptions : UIDebugOptions = defaultUIDebugOptions ,
668668) : Promise < string > {
669- throwInNonTTY ( { message : props . message , stdin : renderOptions ?. stdin , stdout : renderOptions ?. stdout } , uiDebugOptions )
669+ throwInNonTTY ( { message : props . message , stdin : renderOptions ?. stdin } , uiDebugOptions )
670670
671671 return runWithTimer ( 'cmd_all_timing_prompts_ms' ) ( async ( ) => {
672672 let enteredText = ''
@@ -719,7 +719,7 @@ export async function renderDangerousConfirmationPrompt(
719719 { renderOptions, ...props } : RenderDangerousConfirmationPromptOptions ,
720720 uiDebugOptions : UIDebugOptions = defaultUIDebugOptions ,
721721) : Promise < boolean > {
722- throwInNonTTY ( { message : props . message , stdin : renderOptions ?. stdin , stdout : renderOptions ?. stdout } , uiDebugOptions )
722+ throwInNonTTY ( { message : props . message , stdin : renderOptions ?. stdin } , uiDebugOptions )
723723
724724 return runWithTimer ( 'cmd_all_timing_prompts_ms' ) ( async ( ) => {
725725 let confirmed : boolean
@@ -772,23 +772,21 @@ export const keypress = async (stdin = process.stdin, uiDebugOptions: UIDebugOpt
772772
773773interface IsTTYOptions {
774774 stdin ?: NodeJS . ReadStream
775- stdout ?: NodeJS . WriteStream
776775 uiDebugOptions ?: UIDebugOptions
777776}
778777
779- export function isTTY ( { stdin = undefined , stdout , uiDebugOptions = defaultUIDebugOptions } : IsTTYOptions = { } ) {
778+ export function isTTY ( { stdin = undefined , uiDebugOptions = defaultUIDebugOptions } : IsTTYOptions = { } ) {
780779 // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- false should fall through to stdin/terminalSupportsPrompting
781- return Boolean ( uiDebugOptions . skipTTYCheck || stdin || terminalSupportsPrompting ( { stdout } ) )
780+ return Boolean ( uiDebugOptions . skipTTYCheck || stdin || terminalSupportsPrompting ( ) )
782781}
783782
784783interface ThrowInNonTTYOptions {
785784 message : TokenItem
786785 stdin ?: NodeJS . ReadStream
787- stdout ?: NodeJS . WriteStream
788786}
789787
790- function throwInNonTTY ( { message, stdin = undefined , stdout } : ThrowInNonTTYOptions , uiDebugOptions : UIDebugOptions ) {
791- if ( isTTY ( { stdin, stdout , uiDebugOptions} ) ) return
788+ function throwInNonTTY ( { message, stdin = undefined } : ThrowInNonTTYOptions , uiDebugOptions : UIDebugOptions ) {
789+ if ( isTTY ( { stdin, uiDebugOptions} ) ) return
792790
793791 const promptText = tokenItemToString ( message )
794792 const errorMessage = `Failed to prompt:
0 commit comments