aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-14 12:13:43 +0200
committeruser <user@clank>2026-08-14 12:13:43 +0200
commitcba63d04627c7bd06ce80f2be83b7c0d54fb8568 (patch)
treef6a72b8950a673f3eb3cf433279bde1122c0c0ac /Makefile
parentsl0ppty: rename from sl0ptty (diff)
downloadslosh-cba63d04627c7bd06ce80f2be83b7c0d54fb8568.tar.gz
slosh-cba63d04627c7bd06ce80f2be83b7c0d54fb8568.tar.xz
slosh-cba63d04627c7bd06ce80f2be83b7c0d54fb8568.zip
sl0ppty: one-shot --headless printed a blank screen
`--headless` is documented as "run once, print the screen", and it printed nothing for any command that finished — which is most of them. `make smoke` had been showing six blank rows. settle() calls app_reap() every iteration, and app_reap closes a pane whose child has exited; closing the last one takes the tab with it. A command like `sh -c printf ...` exits immediately, so the pane and its content were gone before app_compose ever ran, and the compose found an app with no tabs. So settle() now takes an optional screen and composes into it before the reap rather than after. This is exact rather than a narrowed race: pane_pump() only marks a pane dead on read() returning 0, and it reaches EOF only after it has drained everything the pty had, so a pane cannot be marked dead while its output is still pending and the last snapshot always holds the finished screen. --script passes NULL and is byte-for-byte unchanged. smoke also asked for 6 rows, which after the outer margin, the tab strip and two borders leaves about one row for the pane — under min_pane rows, so it collapsed to an empty frame and would have shown nothing even with the fix. It asks for 12 now. Found while renaming; it predates the rename, reproduced on the commit before.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index dc614d4..88f0f3d 100644
--- a/Makefile
+++ b/Makefile
@@ -70,7 +70,7 @@ test-live: $(BIN) ## the checks that need a real tty (slow)
test-all: test test-live ## everything
smoke: $(BIN) ## compose a screen headlessly and print it
- ./$(BIN) --headless --cols 40 --rows 6 -- /bin/sh -c 'printf "hello \033[1;32msl0ppty\033[0m\n"; echo "wide: 日本語"'
+ ./$(BIN) --headless --cols 40 --rows 12 -- /bin/sh -c 'printf "hello \033[1;32msl0ppty\033[0m\n"; echo "wide: 日本語"'
run: $(BIN) ## build and run
./$(BIN)