Add run_external_console_command action for running terminal applications

This commit is contained in:
Andrzej Rybczak
2020-12-20 17:11:01 +01:00
parent 948d168790
commit 0458c98bae
5 changed files with 42 additions and 2 deletions

View File

@@ -88,7 +88,24 @@ RunExternalCommand::RunExternalCommand(std::string &&command)
void RunExternalCommand::run()
{
GNUC_UNUSED int res;
res = std::system((m_command + " >/dev/null 2>&1").c_str());
res = std::system(("nohup " + m_command + " >/dev/null 2>&1 &").c_str());
}
RunExternalConsoleCommand::RunExternalConsoleCommand(std::string &&command)
: BaseAction(Type::MacroUtility, "run_external_console_command")
, m_command(std::move(command))
{
m_name += " \"";
m_name += m_command;
m_name += "\"";
}
void RunExternalConsoleCommand::run()
{
GNUC_UNUSED int res;
NC::pauseScreen();
res = std::system(m_command.c_str());
NC::unpauseScreen();
}
}