|
|
@ -1469,12 +1469,14 @@ void fInitthread(void * iodata)
|
|
|
|
// A thread function... for the interactive console.
|
|
|
|
// A thread function... for the interactive console.
|
|
|
|
void fIOthread(void * iodata)
|
|
|
|
void fIOthread(void * iodata)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
static const char * HISTORY_FILE = "dfhack-config/dfhack.history";
|
|
|
|
|
|
|
|
|
|
|
|
IODATA * iod = ((IODATA*) iodata);
|
|
|
|
IODATA * iod = ((IODATA*) iodata);
|
|
|
|
Core * core = iod->core;
|
|
|
|
Core * core = iod->core;
|
|
|
|
PluginManager * plug_mgr = ((IODATA*) iodata)->plug_mgr;
|
|
|
|
PluginManager * plug_mgr = ((IODATA*) iodata)->plug_mgr;
|
|
|
|
|
|
|
|
|
|
|
|
CommandHistory main_history;
|
|
|
|
CommandHistory main_history;
|
|
|
|
main_history.load("dfhack.history");
|
|
|
|
main_history.load(HISTORY_FILE);
|
|
|
|
|
|
|
|
|
|
|
|
Console & con = core->getConsole();
|
|
|
|
Console & con = core->getConsole();
|
|
|
|
if (plug_mgr == 0)
|
|
|
|
if (plug_mgr == 0)
|
|
|
@ -1515,7 +1517,7 @@ void fIOthread(void * iodata)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// a proper, non-empty command was entered
|
|
|
|
// a proper, non-empty command was entered
|
|
|
|
main_history.add(command);
|
|
|
|
main_history.add(command);
|
|
|
|
main_history.save("dfhack.history");
|
|
|
|
main_history.save(HISTORY_FILE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
auto rv = core->runCommand(con, command);
|
|
|
|
auto rv = core->runCommand(con, command);
|
|
|
|