fix: run reload command detached

This commit is contained in:
2026-01-12 14:39:00 +03:00
parent c17960d1e6
commit 9803f4948b

View File

@@ -6,6 +6,7 @@
#include "core/theme/template_manager.hpp" #include "core/theme/template_manager.hpp"
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <thread>
namespace clrsync::core namespace clrsync::core
{ {
@@ -58,12 +59,15 @@ template <typename FileType> class theme_renderer
if (!tmpl.reload_command().empty()) if (!tmpl.reload_command().empty())
{ {
int result = std::system(tmpl.reload_command().c_str()); std::string cmd = tmpl.reload_command();
if (result != 0) std::thread([cmd]() {
{ int result = std::system(cmd.c_str());
std::cerr << "Warning: Command " << tmpl.reload_command() if (result != 0)
<< " failed with code " << result << "\n"; {
} std::cerr << "Warning: Reload command '" << cmd
<< "' failed with code " << result << "\n";
}
}).detach();
} }
} }
return Ok(); return Ok();