Panels & chrome Terminal
// Terminal

Terminal

A shell transcript surface. Prompt-led command lines, output coloured by outcome, a blinking cursor.

.talos-terminal renders a shell session line by line in mono. It sits next to two neighbours in talos-data.css: .talos-code is a source listing (syntax colours, a copy bar, no prompts) and .talos-log is a timestamped event feed. The terminal has neither levels nor timestamps nor syntax highlighting: it has commands, their output and a cursor. It lives in the talos-terminal.css module, which all.css loads.

Transcript

PREVIEW
bun run build
$ astro build
dist/wc/index.js 42 kB
dist/all.css 61 kB
build complete in 3.2s
git push origin main
warning: 2 files over 50 kB
error: remote rejected (protected branch)
<div class="talos-terminal" role="region" aria-label="Deploy session" tabindex="0">
  <div class="talos-terminal__line talos-terminal__line--cmd">bun run build</div>
  <div class="talos-terminal__line talos-terminal__line--dim">$ astro build</div>
  <div class="talos-terminal__line talos-terminal__line--out">dist/wc/index.js        42 kB</div>
  <div class="talos-terminal__line talos-terminal__line--ok">build complete in 3.2s</div>
  <div class="talos-terminal__line talos-terminal__line--cmd">git push origin main</div>
  <div class="talos-terminal__line talos-terminal__line--warn">warning: 2 files over 50 kB</div>
  <div class="talos-terminal__line talos-terminal__line--err">error: remote rejected (protected branch)</div>
  <div class="talos-terminal__line talos-terminal__line--cmd"><span class="talos-terminal__cursor"></span></div>
</div>

A scrollable region needs a name and keyboard access, hence role="region", aria-label and tabindex="0". Every command line after the first gets a little space above it, so each command and its output read as one block.

The prompt is not copied

The $ glyph of a --cmd line is generated content (::before, with user-select: none). Select the first line in the demo above and paste it: you get bun run build, never $ bun run build. The glyph comes from the --talos-terminal-glyph token, so a different shell is one declaration.

PREVIEW
Get-Service talos
Running talos Talos telemetry agent
<div class="talos-terminal" style="--talos-terminal-glyph: 'PS> '">…</div>

Line types

PREVIEW
--cmd: a command, led by the prompt glyph
--out: plain output
--ok: success
--warn: a warning
--err: a failure
--dim: noise, echoed commands, timings
--hl: the line to look at
<div class="talos-terminal__line talos-terminal__line--cmd">…</div>
<div class="talos-terminal__line talos-terminal__line--out">…</div>
<div class="talos-terminal__line talos-terminal__line--ok">…</div>
<div class="talos-terminal__line talos-terminal__line--warn">…</div>
<div class="talos-terminal__line talos-terminal__line--err">…</div>
<div class="talos-terminal__line talos-terminal__line--dim">…</div>
<div class="talos-terminal__line talos-terminal__line--hl">…</div>

--hl raises the line’s background and draws a leading bar; it spans the full scroll width even when other lines are longer than the box.

Cursor

PREVIEW
tail -f /var/log/talos.log
<div class="talos-terminal__line talos-terminal__line--cmd">
  tail -f /var/log/talos.log<span class="talos-terminal__cursor"></span>
</div>

.talos-terminal__cursor is a block caret that blinks on a 1.1s step. Under prefers-reduced-motion: reduce it holds on, solid.

Long lines: scroll or wrap

PREVIEW
{"region":"eu-west-3","p95":182,"p99":411,"errors":0,"samples":90412}
{"region":"eu-west-3","p95":182,"p99":411,"errors":0,"samples":90412}
<div class="talos-terminal">…</div>                       <!-- scrolls, fades at the edge -->
<div class="talos-terminal talos-terminal--wrap">…</div>  <!-- wraps, hanging indent -->

By default lines do not wrap: a long line scrolls horizontally and the overflowing edge fades (the scroll-driven talos-code-fade from talos-data.css). --wrap wraps instead, and a wrapped command hangs under its prompt glyph.

Tokens

Every colour is a --talos-terminal-* token mapped onto a surface, text or band token in tokens.css. Rebind any of them on an ancestor to re-skin the terminal.

PREVIEW
uptime
14:32 up 41 days, load averages: 0.42 0.37 0.31
<div class="talos-terminal" style="
  --talos-terminal-bg: hsl(150 30% 6%);
  --talos-terminal-fg: hsl(140 70% 70%);
  --talos-terminal-out: hsl(140 30% 60%);
  --talos-terminal-prompt: hsl(140 70% 45%);">…</div>
TokenDefaultPaints
--talos-terminal-bg--talos-surface-1the surface
--talos-terminal-fg--talos-text-primarycommands, the cursor, --hl text and bar
--talos-terminal-out--talos-text-secondary--out
--talos-terminal-dim--talos-text-tertiary--dim
--talos-terminal-prompt--talos-text-tertiarythe prompt glyph
--talos-terminal-ok--talos-success--ok
--talos-terminal-warn--talos-warning--warn
--talos-terminal-err--talos-danger--err
--talos-terminal-hlforeground at 7%--hl background
--talos-terminal-glyph"$ "the prompt text

Put a terminal inside a window for the title bar; the window hands it the bottom-left cut.