-rw-r--r-- | fox-gui/fx_console.cpp | 22 |
diff --git a/fox-gui/fx_console.cpp b/fox-gui/fx_console.cpp index cf5afbc8..68342677 100644 --- a/fox-gui/fx_console.cpp +++ b/fox-gui/fx_console.cpp @@ -153,11 +153,18 @@ long fx_console::on_key_press(FXObject* obj, FXSelector sel, void* ptr) setCursorPos(m_input_begin + line_len); appendText("\n"); - const char* input_line = m_input.text(); - m_history.add(input_line); - - this->m_status = output_mode; - m_engine->set_request(gsl_shell_thread::execute_request, input_line); + if (m_input == "exit") + { + FXApp* app = getApp(); + app->handle(this, FXSEL(SEL_COMMAND, gsl_shell_app::ID_CONSOLE_CLOSE), NULL); + } + else + { + const char* input_line = m_input.text(); + m_history.add(input_line); + this->m_status = output_mode; + m_engine->set_request(gsl_shell_thread::execute_request, input_line); + } return 1; } @@ -232,11 +239,6 @@ long fx_console::on_lua_output(FXObject* obj, FXSelector sel, void* ptr) { m_status = input_mode; } - else if (status == gsl_shell::exit_request) - { - FXApp* app = getApp(); - app->handle(this, FXSEL(SEL_COMMAND,FXApp::ID_QUIT), NULL); - } else { show_errors(); |