Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

fix(tui): preserve exact-width row endings

justrach898c427e3db9
diff --git a/vendor/zigzag/VENDORED.md b/vendor/zigzag/VENDORED.md
index 464d4d38..651d6840 100644
--- a/vendor/zigzag/VENDORED.md
+++ b/vendor/zigzag/VENDORED.md
@@ -3,6 +3,10 @@
This directory contains Zigzag 0.1.2 from upstream commit
`ad3c8b5d70deba10fef1a0cc33334b8666fb8400`.
+The renderer carries one local compatibility patch: rows are erased before
+they are painted so an exact-width final cell survives on xterm-compatible
+terminals.
+
CodeGraff vendors the dependency because Zigzag's upstream build script still
references the removed Zig 0.16 `b.args` field. The local build script exports
only the `zigzag` module required by CodeGraff, keeping the dependency usable
diff --git a/vendor/zigzag/src/core/program.zig b/vendor/zigzag/src/core/program.zig
index 81a69221..9bfb686f 100644
--- a/vendor/zigzag/src/core/program.zig
+++ b/vendor/zigzag/src/core/program.zig
@@ -815,15 +815,17 @@ pub fn Program(comptime Model: type) type {
// Move cursor home (don't clear entire screen to reduce flicker)
try writer.writeAll(ansi.cursor_home);
- // Write each line, clearing to end of line
+ // Clear each row before drawing it. Clearing afterward erases
+ // the final cell of an exact-width row in xterm-compatible
+ // terminals because the cursor remains on the right margin.
var lines = std.mem.splitScalar(u8, view_output, '\n');
var first = true;
var line_count: usize = 0;
while (lines.next()) |line| {
if (!first) try writer.writeAll("\r\n");
first = false;
+ try writer.writeAll(ansi.line_clear);
try writer.writeAll(line);
- try writer.writeAll(ansi.line_clear_right);
line_count += 1;
}