Terminal tabsPro
Terminal tabs: add, close, rename, cycle with Ctrl+Tab, activity dots on background tabs and exit codes.
oxyn add terminal-tabsThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- In coding-agent apps the in-app terminal is table-stakes: Claude desktop (Ctrl+\`), Verdent, Conductor, Paradev, Orca (splits), Codex app, Zed (terminal threads as agent-panel tabs), Warp, pi-gui, Devin (Shell tab with command history and jump-in-time).
- The new problem is that some tabs are the agent's and some are the user's.
- The user wants to know, from the strip alone: which tabs are running, which finished and how (exit code), which need input, which rang the bell or printed something unseen, and which ones the agent owns — then rename, reorder, split and close them without killing a build by accident.
When not to use
- An app sidebar: use Sidebar instead.
- Fourteen text-glyph loaders (braille, sand, blocks, scanner…) that settle into a check, a warning or a cross when the agent finishes, waits or fails: use Glyph loader instead.
- How long the agent has worked, without the time it spent waiting for you: use Elapsed timer instead.
Installation
Terminal tabs is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add terminal-tabsUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Three
Dev server, tests (exit 0) and a shell.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Busy
Background tabs print often and show dots.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
One
A single quiet tab.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
TerminalTabs
| Prop | Type | Default | Description |
|---|---|---|---|
now_msrequired | u64 | — | Host clock (ms). |
titles | Vec<String> | vec!["dev server".to_string(), "cargo test".to_string(), "zsh".to_string()] | Tab titles. |
activity_ms | u64 | 2500 | Background tabs print a line every this many ms (0 = never). |
height | f32 | 320.0 | Height (px). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| CtrlTab | Next tab (Shift for previous) |
| ←or→ | Move between tabs |
| Double-click | Rename |
| EnterorEscape | Save or cancel a rename |
Accessibility
- A tablist with one tabpanel; background output adds “new output” to the tab name.
- Close buttons are labelled per tab.
From the spec
- Strip:
role="tablist"labelled "Terminals"; tabsrole="tab"witharia-selected,aria-controlsthe grid panel. Accessible name composes owner, title and status: "Agent terminal, cargo test, running, 1 minute 2 seconds" / "Your terminal, zsh, failed with exit code 101, unread output". - Close button: "Close cargo test"; confirm popover is an
alertdialogwith initial focus on Keep running. - Live region (polite): agent tab opened ("Agent opened terminal: cargo test"), finished, failed (with code); assertive only for
AwaitingInputon a tab the user owns. Bells are announced as "Bell in dev-server" at most once per 10 s. - Contrast: status glyphs ≥ 3:1, titles ≥ 4.5:1; failure carries the code as text; owner carries a glyph plus the name in the accessible label — never colour alone.
- Keyboard: §4 global keys; reorder via ⌘/Ctrl+Shift+←/→ announces "Moved to position 3 of 5".
- F6 lands on the active terminal grid; Shift+Tab from the grid reaches the strip.
- Reduced motion: §6 last row.
Motion & interaction
- New tab. Inserts after the active tab; width grows from 0 with
spring.snapwhile neighbours slide; title fades in 120 ms. - Running pulse (from OpenCode
tab-pulse, note 08, MIT): the active running tab draws a 2 px highlight that travels along its top edge — 2.8 s loop, 450 ms attack, rest opacity 0.18. Inactive running tabs show only the slot loader (one busy signal per region, loaders.md §2.3). - Completion. Loader morphs to ✓ / ✕N (
spring.snap160 ms); a single 1.2 s completion pulse (attack 12 %) runs on the tab edge; failure adds an 800 ms edge flash indangerand a 2 × 3 px nudge of the glyph only (the tab itself never shakes). - Unseen output. Dot fades in 120 ms on the first byte that arrives while inactive; viewing the tab clears it with a 240 ms "diffuse" (dot scales 1 → 1.6 and fades; OpenCode's unread glow idea).
- Bell. BEL triggers a 400 ms ring wobble (± 12°, 2 cycles) on the 🔔 glyph, rate-limited to once per 2 s per tab; system attention (dock bounce / taskbar flash) only if the app opts in and the window is unfocused.
- Rename. Title morphs into a field with the same baseline (no jump); commit crossfades 120 ms.
- Drag reorder. 4 px threshold; ghost at 0.95 scale + shadow; neighbours slide to open a gap with
spring.snap; drop settles the ghost into the gap 160 ms. Dragging onto a pane edge hands off to the split preview of workspace-chrome.md §5. Pinned tabs only reorder among pinned. - Overflow. Scrolling the strip glides 200 ms
ease.in-out; the active tab is always scrolled into view with 24 px margin; the⌄ kcount rolls (odometer, tabular digits). - Close. Tab width collapses to 0 (160 ms
ease.in), neighbours fill; Undo toast for user tabs.ConfirmClosepopover scales from the tab (0.96 → 1, 160 ms). - Ownership change. Owner glyph crossfades (200 ms) and the tab edge flashes once in the new owner's tone (acting-indicator rule 2: control changes are visible).
Timing
| Transition | Duration | Delay | Easing / spring | Stagger | Frame rate |
|---|---|---|---|---|---|
| Tab insert / remove | ~200 ms / 160 ms | 0 | spring.snap / ease.in | — | 60 Hz |
| Loader show | 120 ms fade | 300 ms (Starting) | ease.out | — | glyph frame rate (loader-glyph.md) |
| Running edge pulse | 2.8 s loop, 450 ms attack | 0 | sine | max 1 tab (active) | 30 Hz |
| Elapsed appear | 120 ms | at 10 s | ease.out | — | 1 Hz |
| Exit morph | 160 ms | 0 | spring.snap | — | 60 Hz |
| Completion pulse | 1.2 s, attack 12 % | after morph | ease.out | — | 30 Hz |
| Failure edge flash + glyph nudge | 800 ms + 300 ms (2 × 3 px) | after morph | ease.out / linear | — | 60 Hz |
| ✓ fade (shell tabs) | 240 ms | 4 s | ease.in | — | 60 Hz |
| Unseen dot in / diffuse out | 120 ms / 240 ms | 0 | ease.out | — | 60 Hz |
| Bell wobble | 400 ms (2 × ±12°) | rate limit 2 s | spring.soft | — | 60 Hz |
| Rename morph / commit | 120 ms / 120 ms | 0 | ease.out | — | 60 Hz |
| Drag gap / drop settle | ~180 ms / 160 ms | 4 px threshold | spring.snap / ease.out | — | 60 Hz |
| Overflow scroll | 200 ms | 0 | ease.in-out | — | 60 Hz |
| Confirm popover in / out | 160 ms / 120 ms | 0 | ease.out / ease.in | — | 60 Hz |
| Owner change flash | 200 ms crossfade + 400 ms edge | 0 | ease.out | — | 60 Hz |
| Reduced motion | no edge pulses, wobbles, nudges or slides; status glyphs swap with an 80 ms crossfade; running = static ◌ still frame (loaders.md §2.6); insert/remove/reorder instant; unseen dot and bell glyph still appear (information) | — | linear | none | 1 Hz (elapsed only) |
Responsive behaviour
- The strip scrolls sideways when tabs overflow.
Edge cases (spec)
- Many tabs (30+): overflow list is searchable (type to filter); tabs needing attention sort first in the list; the strip keeps min width 96 px per tab (max 200 px).
- Long titles / paths: middle-truncate paths (
~/…/api/src), end-truncate commands; full title in tooltip and accessible name. - Rapid exit/restart (watchers,
cargo watch): status changes faster than 400 ms are coalesced; the completion pulse runs at most once per 2 s per tab. - Bell storms: rate limit 1 wobble / 2 s; > 10 bells / 10 s auto-mutes that tab's bell with a tooltip "Bells muted (too many)".
- Agent closes its own tab: removed without confirm; the transcript keeps the command block.
- User closes an agent tab while the agent waits on it: confirm copy says so; on close the agent's tool call receives
Killed(the app reports it) and the tool row shows "Stopped by you". - Agent wants to type into a user tab: never silently; the app must request control (family G); the tab shows the pending request as
AwaitingInput-style amber with "Agent requests this terminal". - Restored workspace: tabs restore titles, owners and scrollback; processes do not restart; restored tabs show
Idlewith a dim "Restored" tooltip, never fakeRunning. - Remote / sandbox loss: all tabs go
Losttogether; one banner in the panel header rather than N toasts. - RTL: strip order mirrors; owner glyph stays at inline-start; terminal content stays LTR.
- Tiny sizes: at 20 px strips, status slot + 8 ch titles; owner moves into the tooltip.
- Touch: tabs ≥ 44 px tall in a horizontal scroller; long-press opens the tab menu (rename, close, move); close ✕ always visible.
- Slow networks:
Unseenand status come from the PTY host's events; stale status (> 5 s since last heartbeat) shows the glyph at 60 % with "last update 12s ago". - Very fast commands (< 150 ms): no loader, no completion pulse; only an exit badge if non-zero.
Notes for AI
- Import
TerminalTabsfromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
TermTabsElinoxyn_gpui. - Props to set first:
now_ms. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.