diff options
| author | user <user@clank> | 2026-08-15 23:21:40 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-15 23:21:40 +0200 |
| commit | b9ae6cbcbce3816c2b2e8f760f082d3eaa3b5184 (patch) | |
| tree | 8dd1f16ac15edd16f51ba07e37c312ccb89f53f1 /config | |
| parent | sl0ppty: watch what the config was built from, not just what it was called (diff) | |
| download | slosh-b9ae6cbcbce3816c2b2e8f760f082d3eaa3b5184.tar.gz slosh-b9ae6cbcbce3816c2b2e8f760f082d3eaa3b5184.tar.xz slosh-b9ae6cbcbce3816c2b2e8f760f082d3eaa3b5184.zip | |
sl0ppty: say what the config could not honour
A config that half-applied said nothing. An unknown shader, a binding
that does not parse, an include that is not there: the file loaded, that
line did not, and the session announced "config reloaded" as though
nothing had happened. Every one of those messages was already being
produced -- config_load has filled `err` on a successful load since it
was written -- and then dropped on the floor by every caller, because a
non-zero return meant "fine".
So the complaint from the last load is kept, and the front end says it
where it would have said "config reloaded". Once at startup too: a config
that loaded with a complaint still started the session, and the stderr
line goes where nobody attached can read it. The `reload` control verb
answers `{"ok":true,"warning":"..."}` -- ok, because the file did apply,
with the reason attached for a script that cares.
Two things fell out of writing the test for it.
An include's complaint was reported by nobody when the file in the middle
was fine. apply_includes only looked at the return value, so a theme that
loaded while *its* include was missing swallowed the message: the child
returned true, and true meant there was nothing to say. The complaint now
travels up whether or not the include itself loaded.
And a complaint now carries the name of the file it happened in, exactly
once -- added by the file that produced it, never by the files that
included it, because prefixing at every level builds a chain that
truncates before the part that matters. So:
t.kdl: unknown shader: bloom
keys.kdl: line 2: unknown action fly
b.kdl: includes nested too deep (a cycle?)
cannot open /home/you/.config/sl0ppty/themes/nope.kdl
which is enough to know which file to open, in a message that fits in a
toast.
Diffstat (limited to '')
| -rw-r--r-- | config/config.kdl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/config/config.kdl b/config/config.kdl index 7e242c9..1c2bd88 100644 --- a/config/config.kdl +++ b/config/config.kdl @@ -62,8 +62,11 @@ // or `states` block replaces the one it inherited, like every one of those. // // A file that will not load is skipped and the rest of the config still -// applies. Losing your keybindings over a mistyped theme name would be the -// worse answer. +// applies -- losing your keybindings over a mistyped theme name would be the +// worse answer -- and the session says which file it could not honour, in the +// same place it says "config reloaded". That goes for anything a config +// complains about: an unknown shader, a binding that does not parse, an include +// that is not there. The file applied; one line of it did not; you get told. // ── geometry ──────────────────────────────────────────────────────────────── |
