diff options
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 8 |
1 files changed, 6 insertions, 2 deletions
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; |
