From b0e260a2ecd4cb2a7751de3df480ec6ec3092660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Wed, 3 Jun 2026 21:50:22 +0200 Subject: [PATCH] wx: run scripts at boot via the engine (--source / --batch) Now that core has run_script, wire WxFrontend::BootDispatch's `source` to it instead of the "no script interpreter" note. `essim --source bring-up.essim` (and with --batch) now executes the script in the wx frontend too, accumulating the same output the tui produces into the console buffer surfaced by DumpOutput. Verified: `essim --batch --source script.essim` (wx) runs load + set-signal-type + verify and prints the source summary. Co-Authored-By: Claude Opus 4.8 --- src/frontends/wx/wx_frontend.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/frontends/wx/wx_frontend.cpp b/src/frontends/wx/wx_frontend.cpp index 9234469..fbc4889 100644 --- a/src/frontends/wx/wx_frontend.cpp +++ b/src/frontends/wx/wx_frontend.cpp @@ -2,6 +2,7 @@ #include "frontends/wx/wx_frame.hpp" +#include "core/app/script.hpp" #include "core/domain/connect.hpp" #include "core/domain/modules.hpp" #include "core/domain/persist.hpp" @@ -74,8 +75,15 @@ void WxFrontend::BootDispatch(const std::string &raw) { + std::to_string(sys_->connections()->size()) + " connection(s))\n"; } else if (cmd == "source") { - output_ += "source: the wx frontend has no script interpreter " - "(use the tui frontend for scripts).\n"; + ensure_system(); + std::ostringstream out; + app::ScriptResult r = app::run_script(sys_, arg, out); + output_ += out.str(); + if (!r.ok) + output_ += "source: " + r.error + "\n"; + else + output_ += "source: " + arg + " (" + std::to_string(r.lines) + + " line(s), " + std::to_string(r.errors) + " error(s))\n"; } else if (!cmd.empty()) { output_ += "boot: ignored '" + raw + "'.\n"; }