From d191193a1e707a6bfd8fc8bbe1429dbc9f34676f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 12:23:15 -0300 Subject: A Theme hint drops whole names to fit, never cutting one mid-word The names were written into a fixed room until it ran out, the last one cut, and the click's form ran past the 128 bytes a 9P error carries. Each name now goes in whole or not at all, and both forms are sized to fit. Co-Authored-By: Claude Opus 5.5 --- src/exec.zig | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/exec.zig') diff --git a/src/exec.zig b/src/exec.zig index cf4e01ab..88c0705d 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -918,9 +918,13 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[] // A config line is not answered on screen (applyStartupConfig // runs with announce off); a click or a ctl write is. if (!p.announce) return; - var near: [170]u8 = undefined; + // All of it within the 128 bytes a 9P error carries, so a write + // failing with it is cut nowhere: the names get what is left. + const shown = want[0..@min(want.len, 40)]; + const room = 128 -| ("Theme: no theme \"\"; like it: ; Themes lists all".len + shown.len); + var near: [128]u8 = undefined; var text: [256]u8 = undefined; - return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Theme: no theme \"{s}\"; like it: {s}; Themes lists all", .{ want[0..@min(want.len, 40)], colors.themesNear(&near, want) }) catch "Theme: no such theme"); + return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Theme: no theme \"{s}\"; like it: {s}; Themes lists all", .{ shown, colors.themesNear(near[0..@min(room, near.len)], want) }) catch "Theme: no such theme"); }, .font => { if (comptime !font_picker) return; -- cgit v1.3