Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion experiments/shell/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Detect repaint prefixes across output chunk boundaries

When the repaint prefix straddles two consumed chunks, both trace records report repaint:false, hiding the repaint from the timing investigation. OutputQueue::take(8192) in experiments/shell/queues.hpp splits the byte stream without respecting escape-sequence boundaries: for example, 8,188 ordinary bytes followed by this prefix splits it across two chunks, neither of which matches this search. Retain the trailing prefix-length-minus-one bytes between searches, or use a streaming matcher, so detection does not depend on transport chunking.

Useful? React with 👍 / 👎.

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();
}
Expand Down
Loading