@ -405,6 +405,8 @@ namespace DFHack
/// A simple line edit (raw mode)
/// A simple line edit (raw mode)
int lineedit ( const std : : string & prompt , std : : string & output , recursive_mutex * lock , CommandHistory & ch )
int lineedit ( const std : : string & prompt , std : : string & output , recursive_mutex * lock , CommandHistory & ch )
{
{
if ( state = = con_lineedit )
return Console : : FAILURE ;
output . clear ( ) ;
output . clear ( ) ;
reset_color ( ) ;
reset_color ( ) ;
this - > prompt = prompt ;
this - > prompt = prompt ;
@ -414,7 +416,9 @@ namespace DFHack
fflush ( dfout_C ) ;
fflush ( dfout_C ) ;
// FIXME: what do we do here???
// FIXME: what do we do here???
//SDL_recursive_mutexV(lock);
//SDL_recursive_mutexV(lock);
state = con_lineedit ;
std : : getline ( std : : cin , output ) ;
std : : getline ( std : : cin , output ) ;
state = con_unclaimed ;
//SDL_recursive_mutexP(lock);
//SDL_recursive_mutexP(lock);
return output . size ( ) ;
return output . size ( ) ;
}
}
@ -422,8 +426,6 @@ namespace DFHack
{
{
int count ;
int count ;
if ( enable_raw ( ) = = - 1 ) return 0 ;
if ( enable_raw ( ) = = - 1 ) return 0 ;
if ( state = = con_lineedit )
return Console : : FAILURE ;
state = con_lineedit ;
state = con_lineedit ;
count = prompt_loop ( lock , ch ) ;
count = prompt_loop ( lock , ch ) ;
state = con_unclaimed ;
state = con_unclaimed ;