tui: add --batch mode to run a script and print output headless
BootDispatch already runs --restore/--source synchronously before the TUI starts (Source takes its headless drain branch when no screen is attached), so the console buffer is complete by then. New --batch flag dumps that buffer (Tui::DumpOutput) to stdout and exits without launching the TUI — enabling scripted/CI runs and verify output capture (e.g. essim --batch --source s). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,11 @@ void Tui::Print(const std::string &line) {
|
||||
scroll_offset = 0; // any new line snaps the view back to the tail
|
||||
}
|
||||
|
||||
void Tui::DumpOutput(std::ostream &out) const {
|
||||
for (const std::string &line : output)
|
||||
out << line << "\n";
|
||||
}
|
||||
|
||||
void Tui::HistoryUp() {
|
||||
if (history.empty()) return;
|
||||
if (history_idx == -1) history_idx = (int)history.size() - 1;
|
||||
|
||||
Reference in New Issue
Block a user