From 2044049a7f36c5dd5726d21e574ff978abbbc32b Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Fri, 30 Oct 2026 02:17:41 +0800 Subject: [PATCH] diagnose(shell): flag resize repaint batches in the output trace refs #194 A chunk containing the cursor-hide plus home prefix is marked repaint:true together with the grid it was consumed at, which is the missing input for deciding whether the repaint was generated before or after the resize. --- experiments/shell/shell.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/experiments/shell/shell.cpp b/experiments/shell/shell.cpp index 6a857d18..8cd836ca 100644 --- a/experiments/shell/shell.cpp +++ b/experiments/shell/shell.cpp @@ -842,11 +842,15 @@ class ShellWindow { // resize-triggered repaint apart from ordinary output in a failure // artifact; nothing is written unless the variable is set. if (trace_output_) { + // A resize repaint starts by hiding the cursor and homing it; + // flagging it lets the trace show whether the batch was built + // for the previous grid but consumed with the new one. + const bool repaint = bytes.find("\x1b[?25l\x1b[H") != std::string::npos; trace_output_ << "{\"schema\":\"termforge-output-trace-v1\",\"terminal\":" << identity_ << ",\"t_ms\":" << GetTickCount64() << ",\"offset\":" << trace_offset_ << ",\"bytes\":" << bytes.size() << ",\"columns\":" << parser_.screen.width() << ",\"rows\":" << parser_.screen.height() - << "}\n"; + << ",\"repaint\":" << (repaint ? "true" : "false") << "}\n"; trace_output_.flush(); trace_offset_ += bytes.size(); }