aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-16 11:12:20 +0200
committeruser <user@clank>2026-08-16 11:12:20 +0200
commita4e09657ca89fe3cc553ec894e3776abfd4a3e99 (patch)
treeacc330c10f38882e139731052c7964b259a3e826 /src/cmd.c
parentsl0ppty: a pane can set its own shaders (diff)
downloadslosh-a4e09657ca89fe3cc553ec894e3776abfd4a3e99.tar.gz
slosh-a4e09657ca89fe3cc553ec894e3776abfd4a3e99.tar.xz
slosh-a4e09657ca89fe3cc553ec894e3776abfd4a3e99.zip
sl0ppty: a prompt with a memory
`contrib/shader-repl` imports readline, which is most of it: editing, up/down, ctrl-r, and history kept between runs in `$XDG_DATA_HOME/sl0ppty/shader-repl.history`. Chains only -- a `:` command is taken back out of the history it would otherwise fill, because pressing up four times past `:quit` and `:paste` to reach the line you were working on is the annoyance history exists to remove. Tab completes the commands, the nine shader names, the property keys, the two rects, the three channels, and the expression language's own variables and functions. `:help` prints the lot at once, which is the same list from the same place. That list is a claim about what exists, so `tests/test_shader_repl.py` checks it against `src/shader.c` and `src/expr.c` and fails if either grows a name it does not have -- verified by removing `spotlight` and watching it fail. Then it types every name it offers at a real prompt and requires `ok` from a real session, because a name that completes and does not parse is a lie with a keystroke attached. History across two runs, a tab completion, and `:help` are driven the same way, through a pty. Two things that cost me time and are now written down where they bite: keys go into a pane escaped (`\r`, `\t`, `\e[A`) because `raw` takes the rest of one command line and a literal newline ends the command instead of arriving; and Enter is CR, which is what a terminal sends and what readline waits for. Also: **a bare argument on a shader entry is now a complaint.** Every parameter is a property, so `tint color="#000000" spotlight` is not a pass with a spare word, it is a missing `;` -- KDL reads one node, the second name does nothing, and the session used to answer `ok`. It now says `unexpected argument for tint: spotlight (separate entries with ';')`. Found by watching the prompt get used.
Diffstat (limited to 'src/cmd.c')
0 files changed, 0 insertions, 0 deletions