aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_screen.py
diff options
context:
space:
mode:
authorsl0p <sl0p@sl0p.foo>2026-08-13 22:58:24 +0200
committersl0p <sl0p@sl0p.foo>2026-08-13 22:58:24 +0200
commit7d416d95cb49f783f8c4ee6eddd5c2cdcd81bb40 (patch)
tree6aaced8bd6927565816ce48ae07fb5f397d6edf7 /tests/test_screen.py
parentsl0ptty: M2 — server/client split, detach/reattach, control socket (diff)
downloadslosh-7d416d95cb49f783f8c4ee6eddd5c2cdcd81bb40.tar.gz
slosh-7d416d95cb49f783f8c4ee6eddd5c2cdcd81bb40.tar.xz
slosh-7d416d95cb49f783f8c4ee6eddd5c2cdcd81bb40.zip
sl0ptty: M3 — tabs, purposes, and the JSON control API
Tabs are layout trees, one per tab, and panes in every tab keep running: fds, pumping and reaping span all of them, only the current one is composed. A one-row strip shows them (M5 makes it the real status bar) and each label registers a hit, so clicking a tab switches to it through the same mechanism as every other click. C-a c new tab C-a n / C-a p cycle C-a 1..9 select Purposes on panes and tabs with D8's trust model implemented as a lock: declared (from a layout or an operator) outranks in-band, cannot be overridden, and everything is sanitised to [A-Za-z0-9_.:/-] on ingest — 'project:foo bar/../$(rm -rf)' becomes 'project:foobar/../rm-rf'. The in-band path arrives with the OSC scanner in M4 and always passes declared:false; the refusal is already tested. The control API is now JSON in, JSON out: {"cmd":"new-tab","name":"agent","purpose":"project:x.deadbeef"} {"ok":true,"id":2} with panes/tabs/snapshot/send/raw/resize/split/focus/close/select-tab/ set-name/set-purpose/alive/quit. Panes are addressed by id, not by 'the focused one', so a background tab can be scripted. The bare-verb form stays as a harness alias and runs the same code, so the tests cannot drift from the API. Adds a small JSON reader (jsonval.c) — we could only emit until now. 129 checks green.
Diffstat (limited to 'tests/test_screen.py')
-rw-r--r--tests/test_screen.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/test_screen.py b/tests/test_screen.py
index 6b82f1f..0dd24f2 100644
--- a/tests/test_screen.py
+++ b/tests/test_screen.py
@@ -93,9 +93,10 @@ def test_resize():
check("resize changes the composited size",
snap.cols == 50 and snap.rows == 12 and len(snap.line(0)) == 50,
f"{snap.cols}x{snap.rows}")
- # chrome budget: gap 1 (x2 aspect => 2 cols) each side, plus a border
+ # chrome budget: gap 1 (x2 aspect => 2 cols) each side, a border, and the
+ # one-row tab strip along the top
check("the pane grows with the screen, minus its chrome",
- p["content_w"] == snap.cols - 6 and p["content_h"] == snap.rows - 4,
+ p["content_w"] == snap.cols - 6 and p["content_h"] == snap.rows - 5,
str(p))
check("pane still responds after resize", s.alive())