Blog
Six terminals, one GPU.
Loom renders its fleet with xterm.js on WebGL inside a single Tauri window. Keeping six live terminals smooth in one webview takes a budget, a pool, and a fallback. Here is how that works.
The problem
Contexts are a scarce resource.
WebKit sets a cap
Tauri draws through the system webview, and a webview only allows a limited number of live WebGL contexts. Cross the line and the browser starts reclaiming the oldest ones underneath you.
The fleet wants more
Six sessions is the floor, not the ceiling. Add tabs and splits and a naive one-context-per-terminal design runs past the cap on an ordinary afternoon.
Losing one is visible
A reclaimed context is a terminal that stops painting. In an app whose whole job is watching six terminals work, a blank pane is the one failure you cannot ship.
The design
Pool the renderers, budget the panes.
Instead of giving every terminal its own WebGL context for life, Loom pools renderers and spends them where they pay: the large, busy panes you are actually watching. Small panes fall back to xterm.js's DOM renderer, which at that size looks the same and costs no context at all. Every pane stays a real terminal on a native PTY with true color and search, whichever renderer happens to be drawing it.
# contexts go to the panes that earn them
slot 1 large pane webgl
slot 2 large pane webgl
slot 3 split, small dom fallback
slot 4 split, small dom fallback
# resize a pane and it can re-enter the poolGraceful is the feature
The point of the fallback is that you never think about any of this. Panes move between renderers as layouts change, nothing flashes and nothing goes blank, and the GPU budget quietly follows your attention. It is the same instinct that keeps the whole app at about 13 MB: treat every resource as finite and spend it deliberately.
If you want the full feature tour of what those panes can do, from background streaming to WSL per tab on Windows, the terminal page covers it. And the six sessions living inside them are the subject of the fleet.
Hand it the work.
Walk away.
macOS, Linux, and Windows. Around 13 MB. Free and open source.