diff options
| author | sl0p <sl0p@sl0p.foo> | 2026-08-13 23:27:47 +0200 |
|---|---|---|
| committer | sl0p <sl0p@sl0p.foo> | 2026-08-13 23:27:47 +0200 |
| commit | 58afd137373fb395fc0479d091c4da9ffa60324a (patch) | |
| tree | 93839e3c20ff722819444ed22deaef07dc6e6041 /src/server.h | |
| parent | sl0ptty: M6 — the config file, and a README (diff) | |
| download | slosh-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 'src/server.h')
| -rw-r--r-- | src/server.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server.h b/src/server.h index c81dd33..e2b9224 100644 --- a/src/server.h +++ b/src/server.h @@ -9,10 +9,10 @@ /* Run the session in this process (the daemonised half). */ int server_run(const char *name, const char *const argv[], uint16_t cols, - uint16_t rows); + uint16_t rows, const char *layout); /* Fork a server, then wait for its socket to answer. Returns a connected fd. */ int server_spawn(const char *name, const char *const argv[], uint16_t cols, - uint16_t rows); + uint16_t rows, const char *layout); /* Connect to an existing session, or -1. */ int server_connect(const char *name); |
