diff options
| author | sl0p <sl0p@sl0p.foo> | 2026-08-13 22:35:57 +0200 |
|---|---|---|
| committer | sl0p <sl0p@sl0p.foo> | 2026-08-13 22:35:57 +0200 |
| commit | d2940b9643496ed898450f8bd2c640aeb6f8b7a1 (patch) | |
| tree | f98ca5f6c4fb2ba632c08edaab09c917d199316c /tests/live_m0.py | |
| parent | chore: stop tracking __pycache__ (diff) | |
| download | slosh-d2940b9643496ed898450f8bd2c640aeb6f8b7a1.tar.gz slosh-d2940b9643496ed898450f8bd2c640aeb6f8b7a1.tar.xz slosh-d2940b9643496ed898450f8bd2c640aeb6f8b7a1.zip | |
sl0ptty: M1 — layout tree, splits, focus, frames, and the hit list in use
app_t owns the tree, focus, the prefix and what a key means; the interactive
client and the headless driver are now both thin front ends over it, so there
is exactly one implementation of every command.
Layout is the pure function D6 promised: layout(tree, rect) recomputed every
frame, remainder spread across children so nothing drifts, and splitting in a
direction that already exists grows that split rather than nesting — three
splits give three equal columns, not 1/2 + 1/4 + 1/4.
Chrome: rounded frames, aspect-corrected gap, centred titles. The split button
is budgeted BEFORE the title and hit-tested from the rect it was drawn in,
which is the fix the fork needed four attempts to land.
Every painted element registers (rect, action) as it is painted; a click is a
lookup. Mouse into a pane is translated to pane-local coordinates.
Three bugs the harness caught, none of which unit tests would have:
- one click on the split button split twice: press *and* release both fired.
Chrome now acts on press; forwarding to a pane still gets every event.
- callbacks were registered as &fn, but the option is pointer-typed, so the
stored 'callback' was a stack address. Any OSC 2 or DSR jumped into a dead
frame. Now a hard segfault turned into two regression tests.
- a keystroke that changed nothing still emitted a cursor hide/show pair.
The cursor is hidden lazily now, so an idle frame costs zero bytes.
96 checks green in 6s (40 unit, 23 screen, 33 layout), plus 9 live.
Diffstat (limited to 'tests/live_m0.py')
| -rw-r--r-- | tests/live_m0.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/live_m0.py b/tests/live_m0.py index d9f9ae0..58720c2 100644 --- a/tests/live_m0.py +++ b/tests/live_m0.py @@ -59,7 +59,9 @@ def main(): time.sleep(0.2) os.write(fd, b"tput cols\n") out = drain(fd) - ok &= check("SIGWINCH propagates to the pane", b"100" in out, repr(out[-200:])) + # the pane is told its *content* width: 100 columns minus the gap (2 each + # side, aspect-corrected) minus the frame border (1 each side) + ok &= check("SIGWINCH propagates to the pane", b"94" in out, repr(out[-200:])) # the diff emitter must not repaint what did not change os.write(fd, b"echo a\n") |
