From 63983ab4b235fb2b6617e8d055e644e0e986d8fd Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 19:54:01 -0300 Subject: Every setting's bad-value refusal names what it takes: InactiveDim 0-100, MessageLinger 0-60000 milliseconds, a path's limit, a font's form A setting that chooses among words named them, but one that takes a number, a path or a font said only "bad value" over 9P and "does not take that value" from a tag, leaving the range to be guessed. The refusal, both ways, now says its range or what it takes, from one table beside the words. Co-Authored-By: Claude Opus 5.5 --- src/exec.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/exec.zig') diff --git a/src/exec.zig b/src/exec.zig index 215a4fd1..c673aab2 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -1015,12 +1015,13 @@ pub fn applySettingBuiltin(p: *Pardes, setting: config.Runtime.Setting, arg: ?[] return p.reportFailure(p.active, std.fmt.bufPrint(&text, "Shell: {s}", .{refused}) catch "Shell: no such shell"); } } - if (!p.settings.apply(setting, want) and p.announce) p.reportFailure(p.active, "Shell: does not take that value"); + if (!p.settings.apply(setting, want) and p.announce) p.reportFailure(p.active, "Shell: takes " ++ comptime config.Runtime.takes(.shell).?); }, + // Said with what it takes: its words, its range. else => if (!p.settings.apply(setting, arg) and p.announce) { - var text: [96]u8 = undefined; - const takes = if (setting.action == .toggle) "takes on or off" else "does not take that value"; - p.reportFailure(p.active, std.fmt.bufPrint(&text, "{s}: {s}", .{ setting.word, takes }) catch takes); + var text: [160]u8 = undefined; + const why = if (config.Runtime.takes(setting.action)) |values| std.fmt.bufPrint(&text, "{s}: takes {s}", .{ setting.word, values }) else std.fmt.bufPrint(&text, "{s}: does not take that value", .{setting.word}); + p.reportFailure(p.active, why catch "does not take that value"); }, } if (p.settings.colors != previous_colors) { -- cgit v1.3