Merge pull request #514 from maliberty/fix-non-readline-prompt-pipe

mainUtils: match readline behavior when ABC_USE_READLINE is undefined
This commit is contained in:
alanminko 2026-06-05 16:14:23 +07:00 committed by GitHub
commit cd33ba563f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -18,6 +18,8 @@
***********************************************************************/
#include <unistd.h>
#include "base/abc/abc.h"
#include "mainInt.h"
@ -91,7 +93,13 @@ char * Abc_UtilsGetUsersInput( Abc_Frame_t * pAbc )
{
char * pRetValue;
fprintf( pAbc->Out, "%s", Prompt );
fflush( pAbc->Out );
pRetValue = fgets( Prompt, 5000, stdin );
if ( pRetValue == NULL ) { exit(0); }
if ( !isatty( fileno(stdin) ) ) {
fputs( Prompt, pAbc->Out );
fflush( pAbc->Out );
}
return Prompt;
}
#endif