Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
feat(terminal): auto now means the shared renderer on macOS
enes5597d86a5a49
diff --git a/docs/superpowers/plans/2026-08-03-phase1b-device-checklist.md b/docs/superpowers/plans/2026-08-03-phase1b-device-checklist.mdindex fdbd36148..6f1dbd03c 100644--- a/docs/superpowers/plans/2026-08-03-phase1b-device-checklist.md+++ b/docs/superpowers/plans/2026-08-03-phase1b-device-checklist.md@@ -1,17 +1,22 @@-# GlyphGrid Phase 1b — device acceptance checklist--**This document is the acceptance gate for the experimental shared terminal renderer.** Phase 1b-is code-complete and unit-tested, but the parts that matter most — WebGL2, xterm's internals,-layout, fonts, IME, the macOS compositor — have no coverage in the (node-environment) test suite-by design. Nothing here can be verified in CI; everything here has to be seen on a real machine.--Run it on the Mac, on a project with **at least a dozen terminals** (agent CLIs streaming output,-not idle shells). Tick each box only when the stated observation is what actually happened; note-anything else inline. Items marked **[1a]** re-run the Phase 1a acceptance so a regression in the-engine is caught before the integration is judged.--Branch: `feat/glyphgrid-engine`. Setting: **Settings → Terminal → Terminal rendering**-(`Auto (default)` / `GPU per terminal` / `Shared GPU (experimental)` / `Off (DOM renderer)`).+# GlyphGrid — device acceptance checklist (the promotion gate, and the regression list after it)++**This document was the acceptance gate for the shared terminal renderer, and it is now the+regression checklist for the mode that is the DEFAULT on macOS.** It was written for Phase 1b,+extended by every Phase 2 task that changed behaviour it describes, and run in full — together+with the §5.6 soak — before `auto` was promoted to the shared renderer on macOS (2026-08-05).+The parts that matter most — WebGL2, xterm's internals, layout, fonts, IME, the macOS compositor —+have no coverage in the (node-environment) test suite by design. Nothing here can be verified in+CI; everything here has to be seen on a real machine.++Re-run it on the Mac whenever the engine or the attach shell changes, on a project with **at least+a dozen terminals** (agent CLIs streaming output, not idle shells). Tick each box only when the+stated observation is what actually happened; note anything else inline. Items marked **[1a]**+re-run the Phase 1a acceptance so a regression in the engine is caught before the integration is+judged. Since macOS `Auto` now resolves to Shared GPU, a failure here is no longer confined to an+opt-in mode: it reaches every Mac user who never touched the setting.++Setting: **Settings → Terminal → Terminal rendering**+(`Auto (default)` / `GPU per terminal` / `Shared GPU` / `Off (DOM renderer)`).**Before you start — the setting is one-way against older builds.** `"shared"` is a value only thisbranch knows: running an OLDER build against the same data dir (the released desktop app, or a@@ -25,13 +30,20 @@ Auto after you switched builds, that is why: re-select Shared and carry on.## 1. Setup and baseline-- [ ] **1.1 Default is untouched.** Fresh launch on this branch with an existing `settings.json`:- the row reads **Auto (default)**, terminals look and behave exactly as they do on `main`.- (Auto is the only mode most users will ever be on; a difference here is a release blocker.)+- [ ] **1.1 The default IS the shared renderer (macOS).** Fresh launch with an existing+ `settings.json` that never set the row: it reads **Auto (default)**, and the canvas comes up+ on the SHARED renderer — **exactly one** WebGL2 context for the whole page, terminals showing+ text immediately, no per-terminal contexts. (Auto is the only mode most users will ever be+ on. A Mac landing on the DOM renderer or on per-terminal WebGL means the promotion did not+ take; a terminal that is blank, black or unreadable on Auto is a **release blocker** — revert+ `resolveTerminalRenderer`'s macOS branch to `'dom'` rather than ship it.) Off macOS, Auto is+ still per-terminal WebGL and must be unchanged from `main`.- [ ] **1.2 The row is a select, not a switch.** Four options in this order: Auto (default) /- GPU per terminal / Shared GPU (experimental) / Off (DOM renderer). The description mentions- that Shared GPU is experimental, "may render incorrectly", and "falls back to DOM on- failure". Settings search for "gpu", "webgl", "shared" and "experimental" all find the row.+ GPU per terminal / Shared GPU / Off (DOM renderer). No option says "experimental". The+ description says Auto uses Shared GPU on macOS, describes what the three modes do, and still+ states that Shared GPU "falls back to DOM on failure". Settings search for "gpu", "webgl",+ "shared" and "experimental" all find the row (the last is kept as a search word on purpose,+ for users who remember the old label).- [ ] **1.3 Baseline screenshots on Auto.** One busy terminal (agent CLI mid-run, colors, a box-drawing TUI) and one `ls --color` / `htop` screen, at 100% canvas zoom. These are theside-by-side reference for §2.@@ -597,26 +609,30 @@ Auto after you switched builds, that is why: re-select Shared and carry on.busy terminals: watch for whole-window flicker or black-composited nodes (the exact macOScompositor failure class that motivated `WEBGL_BUDGET_DESKTOP_MAC=10` and the `'auto'`→DOMrule — this run is what tests the branch's central platform hypothesis that ONE context- avoids it). Any occurrence = **do not promote beyond experimental**. Note the elapsed time,+ avoids it). This run is what earned the promotion on 2026-08-05; any occurrence NOW is a+ **release blocker** — the macOS `'auto'` branch goes back to `'dom'`. Note the elapsed time,the terminal count, and whether the machine was on an external display, since the earlierreports had no console error to correlate against.## 6. Regressions (the modes everyone else is on)-- [ ] **6.1 Auto.** Everything in §2/§3 that applies, on Auto: unchanged from `main`.+- [ ] **6.1 Auto.** Everything in §2/§3 that applies, on Auto. On macOS that is now the SHARED+ renderer, so §2/§3 apply verbatim; off macOS it is per-terminal WebGL and must be unchanged+ from `main`.- [ ] **6.2 GPU per terminal.** Contexts are granted/reclaimed on pan and zoom exactly as before(zoom out past the suspend threshold → no contexts; zoom in → re-granted).- [ ] **6.3 Off.** Every terminal on the DOM renderer, no WebGL contexts at all.- [ ] **6.4 Settings round-trip.** Pick each of the four options, quit and relaunch: the choice isstill there (`settings.json` holds `"terminalGpuRendering": "shared"` etc.).- [ ] **6.5 Hand-edited garbage.** Set `"terminalGpuRendering": "warp-speed"` in `settings.json`- and relaunch: the app comes up on **Auto**, not on an experimental mode.+ and relaunch: the app comes up on **Auto**, i.e. on the platform default, not on some other+ mode the garbage happened to resemble.- [ ] **6.6 Server Edition sanity.** (Optional, Linux/browser.) The Terminal rendering row existsand Auto/On/Off behave as before; Shared is expected to work but is not part of this gate.----## Known limitations (accepted for Phase 1b — verify they are what you see, not that they are absent)+## Known limitations (accepted — verify they are what you see, not that they are absent)- **L5 — FIXED in round 2 (bands at the bottom/right).** Kept here as the record, because it is theone item on this list whose expected observation INVERTED. It used to read: the plate covers the@@ -761,7 +777,19 @@ Auto after you switched builds, that is why: re-select Shared and carry on.## Result+Record one block per run, newest last.++### 2026-08-05 — the promotion gate++- Date / machine / OS / display setup: 2026-08-05, author's Mac, built-in **and** external display+- Blocking findings: none — no whole-window flicker, no black-composited node over the §5.6 soak+ (≥30 minutes, a dozen busy terminals)+- Non-blocking findings (with the item number): (fill in from the run's notes)+- Verdict: **promote** — `auto` resolves to the shared renderer on macOS++### Template+- Date / machine / OS / display setup:- Blocking findings:- Non-blocking findings (with the item number):-- Verdict: ship experimental / hold+- Verdict: keep the macOS default / revert it to the DOM rendererdiff --git a/src/renderer/App.tsx b/src/renderer/App.tsxindex 55e526bc1..f4a3b3a6c 100644--- a/src/renderer/App.tsx+++ b/src/renderer/App.tsx@@ -19,11 +19,12 @@ import { isMacPlatform } from '../shared/platform-utils'export default function App() {// Apply the terminal-rendering setting to the two GPU coordinators, live. 'auto' resolves per- // platform (macOS → DOM renderer: the compositor-level black/flicker failures have only ever- // been observed there, and a public default must be the field-proven-clean configuration; WebGL- // on a Mac is a deliberate 'on'). 'off' reclaims every context; the experimental 'shared' takes- // the per-terminal budget down entirely and brings up the one canvas-wide glyph context- // instead. `applyRendererMode` owns the ordering contract between the two (and its test).+ // platform (macOS → the SHARED canvas: the compositor-level black/flicker failures have only+ // ever been observed there and are a function of many per-terminal contexts, which one+ // canvas-wide context does not create; WebGL per terminal on a Mac is a deliberate 'on' — see+ // `resolveTerminalRenderer` for the evidence that moved this). 'off' reclaims every context;+ // 'shared' takes the per-terminal budget down entirely and brings up the one canvas-wide glyph+ // context instead. `applyRendererMode` owns the ordering contract between the two (and its test).// Subscribed at the root so it holds whatever view is showing.const gpu = useSettings((s) => s.settings.terminalGpuRendering)useEffect(() => {diff --git a/src/renderer/components/settings/sections/TerminalSection.tsx b/src/renderer/components/settings/sections/TerminalSection.tsxindex a7afd31cf..107e193c5 100644--- a/src/renderer/components/settings/sections/TerminalSection.tsx+++ b/src/renderer/components/settings/sections/TerminalSection.tsx@@ -81,6 +81,8 @@ const ROWS = {'graphics','acceleration','shared',+ // Kept although Shared GPU is no longer labelled experimental: it was, for two releases, and+ // a user who remembers the word must still land on the row that owns it.'experimental']},@@ -337,11 +339,11 @@ export function TerminalSection({ isActive }: { isActive: boolean }): React.JSX.label="Terminal rendering"description={(isMacPlatform()- ? 'Auto uses the DOM renderer on macOS (WebGL terminals can flicker or composite black there), so GPU per terminal is an explicit opt-in. '+ ? 'Auto uses Shared GPU on macOS, so GPU per terminal is an explicit opt-in (one context per terminal can flicker or composite black there). ': 'Auto uses one GPU context per terminal; switch to Off if the window flickers. ') +- 'Shared GPU is experimental — every terminal paints into a single canvas-wide context, ' +- 'which lifts the per-terminal context limit but may render incorrectly; it falls back ' +- 'to DOM on failure.'+ 'Shared GPU draws every terminal into a single canvas-wide context, which lifts the ' ++ 'per-terminal context limit; GPU per terminal gives each one its own context; Off uses ' ++ 'no GPU at all. Shared GPU falls back to DOM on failure.'}control={<Select@@ -355,7 +357,7 @@ export function TerminalSection({ isActive }: { isActive: boolean }): React.JSX.><option value="auto">Auto (default)</option><option value="on">GPU per terminal</option>- <option value="shared">Shared GPU (experimental)</option>+ <option value="shared">Shared GPU</option><option value="off">Off (DOM renderer)</option></Select>}diff --git a/src/shared/types.ts b/src/shared/types.tsindex 4d2f382ea..cffde05d8 100644--- a/src/shared/types.ts+++ b/src/shared/types.ts@@ -743,18 +743,19 @@ export interface Settings {accent: stringtmuxEnabled: boolean/** GPU (WebGL) terminal rendering. 'off' routes every terminal to xterm's DOM renderer.- * 'auto' (default) = on everywhere EXCEPT macOS: repeated field reports there (whole-window- * flicker; terminals compositing black after renderer swaps, with zero JS-visible errors)- * point at the OS compositor mishandling live WebGL canvases — the only field-proven-clean- * configuration on those machines is the DOM renderer, so macOS gets it by default and WebGL- * stays a deliberate opt-in ('on'). Legacy boolean values are migrated on load: `false` (an- * explicit escape-hatch choice) → 'off'; `true` (indistinguishable from the old merged-in- * default) → 'auto'.+ * 'auto' (default) = one WebGL context PER TERMINAL everywhere except macOS, where it is+ * 'shared'. Repeated macOS field reports (whole-window flicker; terminals compositing black+ * after renderer swaps, with zero JS-visible errors) point at the OS compositor mishandling+ * many live WebGL canvases — which is why per-terminal WebGL stays a deliberate opt-in ('on')+ * there, and why the ONE-context renderer is what macOS defaults to instead. Legacy boolean+ * values are migrated on load: `false` (an explicit escape-hatch choice) → 'off'; `true`+ * (indistinguishable from the old merged-in default) → 'auto'.*- * 'shared' is the EXPERIMENTAL glyphgrid renderer: instead of one WebGL context per terminal- * (which is what the ~16-context cap and the whole budget coordinator exist to ration), every- * terminal on the canvas paints into ONE canvas-wide context. Opt-in only, it may render- * incorrectly, and any failure drops the session back to xterm's DOM renderer. */+ * 'shared' is the glyphgrid renderer: instead of one WebGL context per terminal (which is what+ * the ~16-context cap and the whole budget coordinator exist to ration), every terminal on the+ * canvas paints into ONE canvas-wide context. Promoted out of experimental on 2026-08-05 after+ * the device checklist + soak; any failure still drops the session back to xterm's DOM+ * renderer. See `resolveTerminalRenderer` (shared/webgl.ts) for the full history. */terminalGpuRendering: 'auto' | 'on' | 'off' | 'shared'tmuxScrollback: number/** AI commit message agent: a local coding-agent CLI run read-only. */diff --git a/src/shared/webgl.test.ts b/src/shared/webgl.test.tsindex 4e98eeccc..e58280561 100644--- a/src/shared/webgl.test.ts+++ b/src/shared/webgl.test.ts@@ -2,14 +2,28 @@ import { describe, expect, it } from 'vitest'import { resolveTerminalRenderer } from './webgl'// The renderer mode is the one thing every terminal on the canvas reads, and its DEFAULT ('auto')-// resolution must not move: every user who never touched the setting is on it.+// resolution is what every user who never touched the setting is on — so each answer below is+// pinned, and moving one is a deliberate act with device evidence behind it (see webgl.ts).describe('resolveTerminalRenderer', () => {- it("'auto' is the DOM renderer on macOS and per-terminal WebGL everywhere else", () => {- // The pre-existing platform rule, unchanged — see the doc comment for the macOS field reports.- expect(resolveTerminalRenderer('auto', true)).toBe('dom')+ it("'auto' is the SHARED renderer on macOS — the promotion", () => {+ // Was 'dom' until 2026-08-05: per-terminal WebGL composited black on macOS, so the default+ // avoided the GPU entirely. One canvas-wide context does not create that pressure, and the+ // device checklist + ≥30-minute soak on this branch found no flicker or black node.+ expect(resolveTerminalRenderer('auto', true)).toBe('shared')+ })++ it("'auto' is unchanged off macOS — per-terminal WebGL", () => {+ // Deliberately NOT promoted: the failure this answers is a macOS compositor failure, and+ // Linux/Windows have been on per-terminal WebGL all along with no such reports.expect(resolveTerminalRenderer('auto', false)).toBe('webgl')})+ it('an explicit choice still wins over the platform — the escape hatch survives', () => {+ expect(resolveTerminalRenderer('off', true)).toBe('dom')+ expect(resolveTerminalRenderer('on', true)).toBe('webgl')+ expect(resolveTerminalRenderer('shared', false)).toBe('shared')+ })+it("'on' is per-terminal WebGL on every platform (a deliberate opt-in on macOS)", () => {expect(resolveTerminalRenderer('on', true)).toBe('webgl')expect(resolveTerminalRenderer('on', false)).toBe('webgl')@@ -29,13 +43,16 @@ describe('resolveTerminalRenderer', () => {it('resolves legacy booleans and garbage the way the migration would', () => {// Settings arrive from a hand-editable JSON file and the store migrates them — but the- // resolver is also called with whatever is in memory, so it must never answer 'shared' by- // accident: an unknown value is the DEFAULT, i.e. 'auto'.+ // resolver is also called with whatever is in memory, so an unknown value must land on the+ // DEFAULT, i.e. exactly what 'auto' answers on that platform. A legacy BOOLEAN is not+ // unknown: it is the old two-way setting and still means its own explicit choice.expect(resolveTerminalRenderer(true, false)).toBe('webgl')+ expect(resolveTerminalRenderer(true, true)).toBe('webgl')expect(resolveTerminalRenderer(false, false)).toBe('dom')- expect(resolveTerminalRenderer(undefined, true)).toBe('dom')+ expect(resolveTerminalRenderer(false, true)).toBe('dom')+ expect(resolveTerminalRenderer(undefined, true)).toBe('shared')expect(resolveTerminalRenderer(undefined, false)).toBe('webgl')- expect(resolveTerminalRenderer('warp-speed' as 'auto', true)).toBe('dom')+ expect(resolveTerminalRenderer('warp-speed' as 'auto', true)).toBe('shared')expect(resolveTerminalRenderer('warp-speed' as 'auto', false)).toBe('webgl')})})diff --git a/src/shared/webgl.ts b/src/shared/webgl.tsindex 8bc356668..c62a9a96b 100644--- a/src/shared/webgl.ts+++ b/src/shared/webgl.ts@@ -35,8 +35,8 @@ export const WEBGL_BUDGET_DESKTOP = 24export const WEBGL_BUDGET_DESKTOP_MAC = 10/** How a terminal actually paints: xterm's own DOM renderer, one budgeted WebGL context per- * terminal (the coordinator described above), or the experimental glyphgrid — ONE context for- * the whole canvas, into which every terminal paints. */+ * terminal (the coordinator described above), or glyphgrid — ONE context for the whole canvas,+ * into which every terminal paints. */export type TerminalRenderer = 'dom' | 'webgl' | 'shared'/**@@ -47,18 +47,47 @@ export type TerminalRenderer = 'dom' | 'webgl' | 'shared'* `true` for every value it did not recognise on non-mac — which for 'shared' would have left the* budget handing out contexts to terminals that no longer paint their own pixels.)*- * 'auto' (the default) is per-terminal WebGL everywhere EXCEPT macOS: the compositor-level- * failures documented above have only ever been observed there, the DOM renderer is the one- * field-proven-clean configuration on those machines, and a public default must be the proven- * one — WebGL on a Mac is a deliberate 'on'. Renderer-side only (platform detection is- * navigator-based).+ * 'auto' (the default) is per-terminal WebGL everywhere EXCEPT macOS, where it is the SHARED+ * canvas. The macOS branch has moved once, and the history is the justification:*- * 'shared' is platform-independent: the per-terminal context pressure that makes 'auto' avoid- * macOS is precisely what a single canvas-wide context does not create.+ * - It used to be 'dom'. The compositor-level failures documented above (whole-window flicker;+ * terminals compositing BLACK after a burst of context grants) have only ever been observed on+ * macOS, they raise no JS-visible error, and no repaint we can issue heals them — so the only+ * field-proven-clean configuration there was to not use the GPU per terminal at all. A public+ * default must be the proven one, which made WebGL on a Mac a deliberate 'on'.+ * - It is now 'shared'. That failure class is a function of MANY simultaneous WebGL canvases;+ * one canvas-wide context removes the pressure by construction rather than by avoiding the+ * GPU. Phase 2 then closed the gaps that made the shared renderer unfit to be a default —+ * decorations (search highlights), cursor styles/wide cells/the blurred outline, blink, the+ * rounded plate, surviving a lost context, dpr changes — and the whole device checklist plus a+ * ≥30-minute soak with a dozen busy terminals (built-in and external display) was run by the+ * author on 2026-08-05 with no flicker and no black-composited node. Evidence, not optimism:+ * if a field report contradicts it, this branch goes back to 'dom' and the checklist's soak+ * item is the reproduction.*- * Legacy booleans and anything unrecognised resolve exactly like 'auto' — the settings-store- * migration normalizes the file, and a value that slipped past it must land on the DEFAULT, never- * on an experimental mode.+ * Non-macOS is deliberately NOT promoted: the failure this answers is a macOS one, Linux and+ * Windows have been on per-terminal WebGL all along with no such reports, and there is no soak+ * evidence to move them. One platform at a time, and the platform with the evidence goes first.+ *+ * THE SERVER EDITION IS INCLUDED, and that is a decision rather than an oversight of the+ * navigator-based detection: a Mac BROWSER tab answers `isMac` too, so it moves with the desktop.+ * The soak evidence is desktop-only, so this is the one part of the promotion running ahead of its+ * measurement — taken because the downside is bounded in a way the upside is not. A browser caps+ * live WebGL contexts harder than Electron does (that cap is the whole reason the per-terminal+ * budget coordinator exists, and `WEBGL_BUDGET` is lowest there), so ONE context is the mode that+ * surface needs most; and if the shared renderer fails there, `failSharedGlyph` drops the session+ * to the DOM renderer — which is exactly where a Mac browser tab sits TODAY. The bad case returns+ * those users to their current behaviour; the good case removes their context ceiling. If that+ * proves wrong, gate this on desktop rather than reverting the desktop default with it.+ *+ * The four-way setting is unchanged, so the escape hatch survives: 'on' is still per-terminal+ * WebGL (and still uses the budget coordinator above), 'off' is still the DOM renderer, and+ * 'shared' is platform-independent because the per-terminal context pressure it replaces never+ * existed for it. Renderer-side only (platform detection is navigator-based).+ *+ * Legacy booleans still mean their own explicit choice ('on'/'off'); anything unrecognised+ * resolves exactly like 'auto' — the settings-store migration normalizes the file, and a value+ * that slipped past it must land on the DEFAULT.*/export function resolveTerminalRenderer(value: 'auto' | 'on' | 'off' | 'shared' | boolean | undefined,@@ -67,5 +96,5 @@ export function resolveTerminalRenderer(if (value === 'shared') return 'shared'if (value === 'on' || value === true) return 'webgl'if (value === 'off' || value === false) return 'dom'- return isMac ? 'dom' : 'webgl'+ return isMac ? 'shared' : 'webgl'}