aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-17 13:38:15 +0200
committeruser <user@clank>2026-08-17 13:38:15 +0200
commitea39e09a52240ce1d5166e9137e39b7caad499fd (patch)
tree8f841f2ff3f14abce054136ac9a4cf3fe47162fe /src/app.c
parentsl0ppty: a skill for driving it, and the two variables that made one possible (diff)
downloadslosh-ea39e09a52240ce1d5166e9137e39b7caad499fd.tar.gz
slosh-ea39e09a52240ce1d5166e9137e39b7caad499fd.tar.xz
slosh-ea39e09a52240ce1d5166e9137e39b7caad499fd.zip
sl0ppty: a --script pane is told no session rather than somebody else's
`server.c` set `SL0PPTY_SESSION` for its panes and carried a comment saying the value was "deliberately unset under `--script`". Nothing unset it. A value never set is a value inherited, so a script driver started from inside a pane handed its own panes the *outer* session's name -- and the recipe the skill documents, `-s ${SL0PPTY_SESSION:-main} cmd`, then sent its commands to a session it was not in. Not a fallback to a guess: a confident wrong answer, because the name it read was a real session that really answers. Both variables now go through one `session_env()`, called by the server with its name and by the headless driver with NULL, because the two modes have to agree about what a pane is told and a comment in one of them is not agreement. `SL0PPTY_BIN` is set there too rather than inherited, so it names the binary that actually made the pane instead of one that made some pane somewhere -- which is the whole reason that variable exists. Found while explaining a stale pane title, from a check in `test_skill.py` that failed under `make test` and passed on its own. It was not flaky: the suite runs from inside a pane, where these are set, and the tool I ran it from by hand had an environment where they were not. A test whose answer depends on where you run it looks exactly like a race. So it now passes the lie in deliberately: the session under test is started with `SL0PPTY_SESSION=somebody-elses-session`, which makes the difference between "never set" and "cleared" visible from any shell. The mirror check is next to it -- a real session tells its panes its *own* name, even when started from inside another one -- so the obvious wrong fix, unsetting it in both modes, fails. Both were verified by making both wrong versions and watching each test bite. The two title checks now wait for the line instead of sampling after 120ms. That was not the bug (a shell prints in about 12ms here, even under disk churn) and it is one assumption fewer.
Diffstat (limited to 'src/app.c')
0 files changed, 0 insertions, 0 deletions