1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
|
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>slosh: a terminal multiplexer</title>
<meta name="description" content="slosh: panes, tabs, sessions you can detach from. One static binary, written in C on libghostty-vt.">
<!-- The embed card, for Discord/X/Slack link previews. card.png is drawn
from logo.txt by web/gen-card; theme-color is the accent stripe Discord
puts on the embed. URLs are absolute because scrapers want them so. -->
<meta property="og:title" content="slosh: a terminal multiplexer">
<meta property="og:description" content="Panes, tabs, sessions you can detach from. One static binary, written in C on libghostty-vt.">
<meta property="og:url" content="https://slosh.foo/">
<meta property="og:type" content="website">
<meta property="og:image" content="https://slosh.foo/card.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://slosh.foo/card.png">
<meta name="theme-color" content="#ff5fd7">
<link rel="stylesheet" href="site.css">
<link rel="stylesheet" href="recordings/player.css">
</head>
<body>
<a class="logo-float" href="#" aria-label="slosh: back to top">
<span class="logo-art"></span>
</a>
<main>
<header class="hero">
<div class="logo logo-art" role="img" aria-label="slosh"></div>
<p class="tagline">a modern terminal multiplexer written in C on top of
<a href="https://github.com/ghostty-org/ghostty">libghostty-vt</a>.</p>
<p class="hero-links">
<a class="btn" href="#install">install</a>
<a class="btn ghost" href="#try">try it</a>
<a class="btn ghost" href="docs/">browse docs</a>
<!-- @VERSION@ is stamped by web/build-site from ./VERSION, which the
release invariant keeps equal to the newest tag -->
<a class="btn ghost" href="https://github.com/sl0p-foo/slosh/releases/latest">@VERSION@</a>
</p>
</header>
<section id="different" style='margin-top:0;'>
<div class="scrolly">
<div class="scrolly-stage">
<div class="stage-pin">
<div data-sloshcast="recordings/panes.json" data-loop data-name="panes" class="stage-active"></div>
<div data-sloshcast="recordings/sessions.json" data-loop data-name="sessions"></div>
<div data-sloshcast="recordings/reflow.json" data-loop data-name="reflow"></div>
<div data-sloshcast="recordings/config.json" data-loop data-name="config"></div>
<div data-sloshcast="recordings/shaders.json" data-loop data-name="shaders"></div>
<div data-sloshcast="recordings/scripting.json" data-loop data-name="scripting"></div>
<div data-sloshcast="recordings/extras.json" data-loop data-name="extras"></div>
</div>
</div>
<div class="scrolly-steps">
<article class="step active" data-cast="panes">
<h3>Panes and tabs, what else?</h3>
<p>One keycombo to split, or just click, because we don't hate the mouse.</p>
<ul>
<li>click the middle of a border to split toward it</li>
<li>drag the gap to move the boundary</li>
<li>drag a pane by its title </li>
<li>zoom, tab away, come back: nothing lost!</li>
</ul>
</article>
<article class="step" data-cast="sessions">
<h3>Sessions outlive everything.</h3>
<p>Detach, let the ssh connection die, come back tomorrow: every pane
exactly where you left it.</p>
<ul>
<li>detach mid-thought, reattach mid-thought</li>
<li>attach from two terminals at once: both type, both see</li>
<li>keep separate sessions for separate lives; hop between them</li>
<li>a command that died while you were away keeps its output and exit status</li>
</ul>
</article>
<article class="step" data-cast="reflow">
<h3>Responsive terminal layouts.</h3>
<p>Layouts (re)flow in the way you expect, nothing drifts.</p>
<ul>
<li>quarter-turn the whole layout in place</li>
<li>shrink until boxes become a tidy list</li>
<li>grow back: the exact arrangement returns</li>
</ul>
</article>
<article class="step" data-cast="config">
<h3>Make it yours, live.</h3>
<p>One config file, hot-reloaded. Press <kbd>C-a</kbd>
<kbd>e</kbd> to <kbd>$EDITOR</kbd> it in place.</p>
<ul>
<li>retheme the whole session with one magic vimfu substitution</li>
<li>padding, gaps, titles: every knob, applied as you watch</li>
<li><code>compact true</code>: for those who value their terminal real estate.</li>
</ul>
</article>
<article class="step" data-cast="shaders">
<h3>Nifty visual effects, written as expressions.</h3>
<p>Dim, tint, rulers, spotlights: over a pane's cells or over its
frame, with strengths computed from <code>x</code>, <code>y</code>, the
cursor, the clock.</p>
<ul>
<li>tint a frame, rule a column, scanline the lot</li>
<li>a spotlight that follows the cursor as you type</li>
<li><code>:load shine</code>, and a shipped preset runs light along the frame</li>
<li>a pane rings unfocused, its border flashes</li>
</ul>
</article>
<article class="step" data-cast="scripting">
<h3>Built to be driven.</h3>
<p>One JSON object per line over the session's socket: the same depth
the keyboard gets. An agent can hold the other end.</p>
<ul>
<li>split and rename panes from a script, replies and all</li>
<li>a program draws status and buttons into its own frame</li>
<li>the click comes back on that program's stdin</li>
</ul>
</article>
<article class="step" data-cast="extras">
<h3>Floats, and the small comforts.</h3>
<p><kbd>C-a</kbd> <kbd>F</kbd> drops a throwaway shell on top of
whatever you are doing: a monitor, a man page, a quick command.</p>
<ul>
<li>move it with the keys that move boundaries; grow it about its
centre</li>
<li><kbd>C-a</kbd> <kbd>?</kbd> shows a cheatsheet built from the
bindings actually active, it cannot disagree with your
keyboard</li>
<li><code>exit</code> closes it like any shell. the layout never
flinched</li>
</ul>
</article>
</div>
</div>
</section>
<!-- ================================================================ -->
<section id="try">
<h2>try it</h2>
<p>A riscv64 Linux with slosh as the thing you land in, booted right here.
Nothing is installed, nothing leaves the tab, and the machine is throwaway
(reload for a fresh one).
<a href="demo/">Prefer a whole tab?</a></p>
<div class="try-stage" id="try_stage">
<button class="boot" type="button" id="boot_btn">boot the machine</button>
<p class="aside">riscv64 · <a href='https://bellard.org/tinyemu/'>TinyEMU</a>, compiled to wasm · yours until you reload</p>
</div>
<p class="try-live" id="try_live" hidden>
<button class="boot ghost" type="button" id="kill_btn">power off</button>
</p>
</section>
<!-- ================================================================ -->
<section id="install">
<h2>install</h2>
<p>
Prebuilt static binaries for Linux, macOS and Windows (x86-64 and ARM64)
are on the
<a href="https://github.com/sl0p-foo/slosh/releases/latest">latest release</a>
page. The macOS binary is signed and notarized.
We also provide some packaged versions of slosh, instructions can be found below.
</p>
<div class="install">
<input class="os" type="radio" name="os" id="os-macos" checked>
<input class="os" type="radio" name="os" id="os-arch">
<input class="os" type="radio" name="os" id="os-source">
<div class="os-tabs">
<label for="os-macos">macOS (homebrew)</label>
<label for="os-arch">linux (pacman)</label>
<label for="os-source">source</label>
</div>
<div class="os-panel" id="install-macos">
<div class="cmd" data-copy="brew tap sl0p-foo/slosh && brew install slosh">
<pre><code><span class="prompt">$</span> brew tap sl0p-foo/slosh
<span class="prompt">$</span> brew install slosh</code></pre>
<button class="copy" type="button" aria-label="Copy commands">copy</button>
</div>
<p class="aside">Builds from source in under a minute; the only
dependency is <a href="https://ziglang.org">zig</a>, which the formula
pulls in.</p>
</div>
<div class="os-panel" id="install-arch">
<div class="cmd" data-copy="curl -fsSLO https://slosh.foo/arch/slosh.asc && sudo pacman-key --add slosh.asc && sudo pacman-key --lsign-key 0F67C909938CFFA8A76B59FD8D69B55A0E9056B9">
<pre><code><span class="c"># enroll the signing key, once</span>
<span class="prompt">$</span> curl -fsSLO https://slosh.foo/arch/slosh.asc
<span class="prompt">$</span> sudo pacman-key --add slosh.asc
<span class="prompt">$</span> sudo pacman-key --lsign-key 0F67C909938CFFA8A76B59FD8D69B55A0E9056B9</code></pre>
<button class="copy" type="button" aria-label="Copy commands">copy</button>
</div>
<div class="cmd" data-copy="[slosh]
Server = https://slosh.foo/arch/$arch">
<pre><code><span class="c"># add to /etc/pacman.conf</span>
[slosh]
Server = https://slosh.foo/arch/$arch</code></pre>
<button class="copy" type="button" aria-label="Copy pacman.conf section">copy</button>
</div>
<div class="cmd" data-copy="sudo pacman -Sy slosh">
<pre><code><span class="prompt">$</span> sudo pacman -Sy slosh
<span class="prompt">$</span> sudo pacman -S ghostty-terminfo <span class="c"># optional, x86_64 only: the TERM entry</span>
<span class="c"># system-wide; slosh self-installs it otherwise</span></code></pre>
<button class="copy" type="button" aria-label="Copy command">copy</button>
</div>
<p class="aside">Built, signed packages. The fingerprint to check before
the <code>--lsign-key</code>: the same key is
<a href="https://github.com/sl0p-foo/slosh/blob/master/contrib/arch/slosh.asc">contrib/arch/slosh.asc</a>
in git, so the file fetched from the website can be compared against the
one in the source. The PKGBUILD, for building it yourself, is in
<a href="https://github.com/sl0p-foo/slosh/tree/master/contrib/arch">contrib/arch</a>
too; the same instructions at <a href="arch/">arch/</a>.</p>
</div>
<div class="os-panel" id="install-source">
<div class="cmd">
<pre><code><span class="prompt">$</span> git clone https://github.com/sl0p-foo/slosh.git && cd slosh
<span class="prompt">$</span> make vendor <span class="c"># the vendored terminal core, once</span>
<span class="prompt">$</span> make all <span class="c"># about a second</span>
<span class="prompt">$</span> sudo make install <span class="c"># or: make install PREFIX=$HOME/.local</span></code></pre>
</div>
<p class="aside">Needs <a href="https://ziglang.org">zig</a> 0.16 and
nothing else: no cmake, no autotools, no libraries. The result is one
static binary. Bare <code>make</code> prints the target list;
<code>make all</code> is the build, and <code>make install</code>
puts the binary in <code>$PREFIX/bin</code> along with the manpages and
the example configuration. Windows cross-compilation is
<code>make -f Makefile.windows</code>;
<a href="docs/windows.html">the details</a>.</p>
</div>
</div>
</section>
<section id="contributing">
<h2>contributing</h2>
<p>
slosh is developed in the open at
<a href="https://github.com/sl0p-foo/slosh">github.com/sl0p-foo/slosh</a>:
issues, patches and pull requests welcome.
</p>
<p>
For everything that is not an issue yet (a question, an idea, a
screenshot of a setup you are proud of) there is the
<a href="https://discord.gg/9rmHTNsnKY">sl0p discord</a>.
</p>
</section>
</main>
<footer class="foot">
slosh is a <a href="https://sl0p.foo">sl0p.foo</a> product
</footer>
<script>
window.SLOSHCAST_SPEED = 1.75;
</script>
<script src="recordings/player.js"></script>
<script>
for (const box of document.querySelectorAll(".cmd[data-copy]")) {
const btn = box.querySelector(".copy");
btn.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(box.dataset.copy);
btn.textContent = "copied";
setTimeout(() => (btn.textContent = "copy"), 1200);
} catch {
btn.textContent = "select it";
}
});
}
const heroEl = document.querySelector(".hero");
const littleLogo = document.querySelector(".logo-float");
const tryEl = document.getElementById("try");
if (heroEl && littleLogo && "IntersectionObserver" in window) {
const seen = { heroGone: false, pastTour: false, clear: true };
const apply = () =>
littleLogo.classList.toggle(
"show",
seen.heroGone && !seen.pastTour && seen.clear
);
new IntersectionObserver(([e]) => {
seen.heroGone = !e.isIntersecting;
apply();
}).observe(heroEl);
if (tryEl)
new IntersectionObserver(
([e]) => {
seen.pastTour = e.isIntersecting || e.boundingClientRect.top < 0;
apply();
},
{ rootMargin: "0px 0px -45% 0px" }
).observe(tryEl);
const stagePinEl = document.querySelector(".stage-pin");
let measuring = false;
const collide = () => {
measuring = false;
const player = stagePinEl && stagePinEl.querySelector(".stage-active");
if (!player) return;
const p = player.getBoundingClientRect();
const l = littleLogo.getBoundingClientRect();
seen.clear = p.top > l.bottom + 8 || p.bottom < l.top - 8;
apply();
};
addEventListener(
"scroll",
() => {
if (!measuring) {
measuring = true;
requestAnimationFrame(collide);
}
},
{ passive: true }
);
collide();
}
// One column: the hero itself hovers (position: sticky, in site.css), and
// the stage sticks just under it -- at the hero's height, which wrapping
// buttons keep from being any fixed number. Measured here, spent in the
// stylesheet as --hero-h.
if (heroEl) {
const setHeroH = () =>
document.documentElement.style.setProperty(
"--hero-h",
heroEl.offsetHeight + "px"
);
setHeroH();
new ResizeObserver(setHeroH).observe(heroEl);
}
const stagePin = document.querySelector(".stage-pin");
function placeLittleLogo() {
const player = stagePin && stagePin.querySelector(".stage-active");
if (!player || !littleLogo) return;
const pad = parseFloat(getComputedStyle(stagePin).paddingBottom) || 0;
const termTop = (innerHeight - pad) / 2 - player.offsetHeight / 2;
const air = termTop - littleLogo.offsetHeight;
littleLogo.style.top = Math.max(8, air / 2) + "px";
littleLogo.style.visibility = air >= 16 ? "" : "hidden";
}
if (stagePin && littleLogo) {
placeLittleLogo();
window.addEventListener("resize", placeLittleLogo);
const ro = new ResizeObserver(placeLittleLogo);
for (const el of stagePin.querySelectorAll("[data-sloshcast]")) ro.observe(el);
}
const bootBtn = document.getElementById("boot_btn");
if (bootBtn) {
const stage = document.getElementById("try_stage");
const live = document.getElementById("try_live");
const poster = [...stage.children];
bootBtn.addEventListener("click", () => {
if (matchMedia("(max-width: 54rem)").matches) {
location.href = "demo/";
return;
}
stage.classList.add("booted");
const frame = document.createElement("iframe");
frame.src = "demo/?embed=1";
frame.className = "try-frame";
frame.title = "slosh, running in a riscv64 machine in this page";
stage.replaceChildren(frame);
stage.scrollIntoView({ block: "center" });
frame.addEventListener("load", () => frame.contentWindow.focus());
live.hidden = false;
});
document.getElementById("kill_btn").addEventListener("click", () => {
stage.classList.remove("booted");
stage.replaceChildren(...poster);
live.hidden = true;
stage.scrollIntoView({ block: "center" });
});
}
const ua = navigator.userAgent;
const os = /Windows/i.test(ua) ? "windows" : /Mac/i.test(ua) ? "macos" : "linux";
const radio = document.getElementById("os-" + os);
if (radio) radio.checked = true;
const tour = document.querySelector(".scrolly");
if (tour) {
const mounts = [...tour.querySelectorAll(".stage-pin [data-sloshcast]")];
const steps = [...tour.querySelectorAll(".step")];
const ctl = (el) => el._sloshcast;
let current = null;
for (const s of steps) {
s.addEventListener("click", (ev) => {
if (s.classList.contains("active")) return;
if (ev.target.closest("a")) return;
if (!getSelection().isCollapsed) return;
s.scrollIntoView({ block: "center" });
});
}
const show = (name) => {
if (!name || name === current) return;
current = name;
for (const el of mounts) {
const on = el.dataset.name === name;
el.classList.toggle("stage-active", on);
if (!ctl(el)) continue;
if (on) {
ctl(el).restart();
ctl(el).play();
} else ctl(el).pause();
}
};
const mid = new IntersectionObserver(
(entries) => {
for (const e of entries)
if (e.isIntersecting) {
for (const s of steps) s.classList.toggle("active", s === e.target);
show(e.target.dataset.cast);
}
},
{ rootMargin: "-45% 0px -45% 0px" },
);
for (const s of steps) mid.observe(s);
new IntersectionObserver((entries) => {
for (const e of entries) {
const active = mounts.find((m) => m.classList.contains("stage-active"));
if (!active || !ctl(active)) continue;
if (e.isIntersecting) ctl(active).play();
else ctl(active).pause();
}
}).observe(tour);
tour.addEventListener("sloshcast", (e) => {
if (e.target.classList.contains("stage-active")) {
ctl(e.target).fit();
ctl(e.target).play();
}
});
}
</script>
</body>
</html>
|