diff --git a/construct/console.cc b/construct/console.cc index 2a6d97c8d..270b8dbad 100644 --- a/construct/console.cc +++ b/construct/console.cc @@ -74,6 +74,9 @@ construct::console::queue; decltype(construct::console::quit_when_done) construct::console::quit_when_done; +decltype(construct::console::interactive_when_done) +construct::console::interactive_when_done; + bool construct::console::spawn() { @@ -195,10 +198,13 @@ construct::console::handle_queued() if(!next_command()) break; - if(!quit_when_done) + if(run::level != run::level::RUN) return true; - if(run::level != run::level::RUN) + if(interactive_when_done) + return false; + + if(!quit_when_done) return true; static ircd::ios::descriptor descriptor diff --git a/construct/console.h b/construct/console.h index 4ae1c9a7a..a87de64bc 100644 --- a/construct/console.h +++ b/construct/console.h @@ -20,6 +20,7 @@ struct construct::console static std::once_flag seen_message; static std::deque queue; static bool quit_when_done; + static bool interactive_when_done; std::string line; std::string record_path; diff --git a/construct/construct.cc b/construct/construct.cc index b573b1fa7..5c32d134f 100644 --- a/construct/construct.cc +++ b/construct/construct.cc @@ -243,6 +243,7 @@ noexcept try // without having to send a ctrl-c for it, that is provided here. This does // not actually take effect until it's processed in the ios.run() below. if(cmdline || !execute.empty()) + construct::console::interactive_when_done = cmdline, construct::console::spawn(); // If the user wants to immediately process console commands