aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-16 15:05:02 +0200
committeruser <user@clank>2026-08-16 15:05:02 +0200
commitab8165a9717b4dd2b6dc750f504d4f67f6d9fdc6 (patch)
treeaca329fd1453a0739d714bcd190cd155780dd0ee /src/config.c
parentsl0ppty: a prompt with a memory (diff)
downloadslosh-ab8165a9717b4dd2b6dc750f504d4f67f6d9fdc6.tar.gz
slosh-ab8165a9717b4dd2b6dc750f504d4f67f6d9fdc6.tar.xz
slosh-ab8165a9717b4dd2b6dc750f504d4f67f6d9fdc6.zip
sl0ppty: three ways back from a painted pane
printf '\033]5577;1;shader;\033\\' # from the program sl0ppty cmd '{"cmd":"clear-shaders","id":0}' # from outside it bind "z" "clear-shaders" # from the keyboard `app_clear_pane_shaders` empties both of a pane's chains and says whether there was anything there, which is what lets a key answer "shaders cleared" or "no shaders on this pane" instead of maybe having done something. In-band it is not a new verb: naming no rect means all of them. `shader;` sits under `shader;chrome;` and `shader;content;` as the degenerate case of "which rect", so a program puts a pane back in one exchange and cannot leave it half done. `contrib/shader-repl`'s `:both` now uses that rather than two. **None of the three is gated on `in_band_shaders`.** A chain outlives the setting that allowed it -- paint a pane, then turn the setting off, and the paint is still there, because a chain belongs to the pane and not to the file (there is a test that reloads with it off and clears anyway). A way out that the setting can take away is not a way out. The operator path matters for the same reason: the program that made a pane unreadable is not always in a state to put it back. They clear what the *pane* set. The config's chains and the session's own dimming are not this pane's doing and are derived every frame anyway. The action is bound to nothing, like `scroll-up`: it is in the palette, which is what the palette is for, and the docs say to bind it if you leave the setting on. Which is where a second bug turned up -- the palette truncates a label at 26 characters, so "undo this pane's own shaders" read as "undo this pane's own shade" on screen. Renamed to fit, and `tests/test_palette.py` now checks every label against the column, since nothing failed for that: it just looked like a typo in front of someone.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 70667ba..24837cb 100644
--- a/src/config.c
+++ b/src/config.c
@@ -24,6 +24,7 @@ static const struct {
{"resize-left", ACT_RESIZE_LEFT}, {"resize-right", ACT_RESIZE_RIGHT},
{"resize-up", ACT_RESIZE_UP}, {"resize-down", ACT_RESIZE_DOWN},
{"equalize", ACT_EQUALIZE},
+ {"clear-shaders", ACT_CLEAR_SHADERS},
{"rotate-layout", ACT_ROTATE_LAYOUT},
{"scroll-up", ACT_SCROLL_UP}, {"scroll-down", ACT_SCROLL_DOWN},
{"scroll-page-up", ACT_SCROLL_PAGE_UP},
@@ -829,6 +830,9 @@ static const struct {
/* Short enough to fit the palette's label column, which truncates at 26 —
* "give every pane an even share" read as "give every pane an even sh". */
{ACT_EQUALIZE, "size", "even out every split"},
+ /* Under `panes`, not `size`: it undoes what the program in the pane did to
+ * the pane, which is a fact about that pane and not about the layout. */
+ {ACT_CLEAR_SHADERS, "panes", "clear this pane's shaders"},
{ACT_ROTATE_LAYOUT, "size", "turn the layout a quarter"},
{ACT_NEW_TAB, "tabs", "new tab"},