aboutsummaryrefslogtreecommitdiffstats
path: root/src/sl0ptty.h
diff options
context:
space:
mode:
authorsl0p <sl0p@sl0p.foo>2026-08-13 23:27:47 +0200
committersl0p <sl0p@sl0p.foo>2026-08-13 23:27:47 +0200
commit58afd137373fb395fc0479d091c4da9ffa60324a (patch)
tree93839e3c20ff722819444ed22deaef07dc6e6041 /src/sl0ptty.h
parentsl0ptty: M6 — the config file, and a README (diff)
downloadslosh-58afd137373fb395fc0479d091c4da9ffa60324a.tar.gz
slosh-58afd137373fb395fc0479d091c4da9ffa60324a.tar.xz
slosh-58afd137373fb395fc0479d091c4da9ffa60324a.zip
sl0ptty: M7 — layout files and suspended panes
A session can be a file: layout { tab name="api" purpose="project:api.a1b2c3" cwd="~/dev/api" { pane purpose="agent:main" command="pi" pane split="rows" { pane purpose="service:web" command="npm run dev" suspended=true pane purpose="shell:scratch" } } } built by --layout at startup or applied to a running session with {"cmd":"apply-layout", path|kdl, replace?}. Idempotency stays with the caller, which is where sl0ppi's CLI design already puts it: diff list-tabs against the projects on disk, then apply what is missing. close-tab completes that loop. Purposes a layout declares are locked, so identity comes from the file rather than from whatever the program inside prints — tested by having a pane try to take one in-band and be refused. Suspended panes: a pane that exists, is laid out, and has run nothing, showing what it would run and starting on its first keystroke (which is consumed, not forwarded). This is sl0ppi's D6 — a root with twelve projects must not become twelve running servers — and it is the reason can be cheap. Also fixes a test-isolation bug latent since M2: the live tests attached to the session called "main", which is whatever happens to exist on the box rather than one they created. They now use a unique session per run, which is how a run that had somebody else's htop in it became reproducible. 284 checks green (257 headless + 27 live).
Diffstat (limited to '')
-rw-r--r--src/sl0ptty.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sl0ptty.h b/src/sl0ptty.h
index 828de0e..eab209c 100644
--- a/src/sl0ptty.h
+++ b/src/sl0ptty.h
@@ -123,6 +123,13 @@ typedef void (*pane_osc_fn)(pane_t *p, const char *verb, const char *payload,
pane_t *pane_new(const char *const argv[], uint16_t cols, uint16_t rows,
const char *cwd);
+/* `suspended`: create the pane but run nothing until pane_start(). `label` is
+ * what to show in the meantime (usually the command line). */
+pane_t *pane_new_ex(const char *const argv[], uint16_t cols, uint16_t rows,
+ const char *cwd, bool suspended, const char *label);
+bool pane_suspended(const pane_t *p);
+const char *pane_label(const pane_t *p);
+bool pane_start(pane_t *p);
void pane_free(pane_t *p);
int pane_fd(const pane_t *p);
bool pane_alive(const pane_t *p);