Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
19b3678
fix(terminal): rebuild WebGL renderers once the glyph atlas reaches a…
atharv2309-commits Nov 17, 2026
1de8b63
fix(terminal): ignore atlas pages from the rebuild's own repaint
atharv2309-commits Nov 17, 2026
56e7c48
Merge remote-tracking branch 'origin/main' into brennanb2025/pr-43465…
brennanb2025 Nov 20, 2026
9a46852
fix(terminal): space atlas-memory rebuilds and re-arm them on output
brennanb2025 Nov 20, 2026
26088c7
fix(terminal): drop atlas output watchers with their renderer
brennanb2025 Nov 20, 2026
8435e56
fix(terminal): watch output for each renderer's lifetime
brennanb2025 Nov 20, 2026
85552a5
fix(terminal): release the atlas output watcher when WebGL attach fails
brennanb2025 Nov 20, 2026
cd64933
fix(terminal): scope atlas-memory rebuilds to the grown atlas
brennanb2025 Nov 20, 2026
3371b77
fix(terminal): re-arm atlas rebuilds on PTY output into that atlas
brennanb2025 Nov 20, 2026
5a20564
fix(terminal): reattach atlas-rebuilt renderers only in visible panes
brennanb2025 Nov 20, 2026
53a7156
fix(terminal): keep undisplayed panes detached and space deferred reb…
brennanb2025 Nov 20, 2026
159e6f4
fix(terminal): decide atlas-rebuild reattach per on-screen pane
brennanb2025 Nov 20, 2026
07d0320
refactor(terminal): type the atlas identity and read it without casts
brennanb2025 Nov 20, 2026
04a147a
refactor(terminal): identify the glyph atlas by its pages list
brennanb2025 Nov 20, 2026
f1c489b
fix(terminal): index atlas owners, honor stale visibility and paint r…
brennanb2025 Nov 20, 2026
99971b6
fix(terminal): follow atlas swaps, skip chat-covered panes and coales…
brennanb2025 Nov 20, 2026
a968cda
test(terminal): keep the fake pane cast annotated
brennanb2025 Nov 20, 2026
7d58f76
fix(terminal): re-index after xterm assigns the new atlas and keep th…
brennanb2025 Nov 20, 2026
82f728b
fix(terminal): keep chat-covered panes detached on atlas rebuild and …
brennanb2025 Nov 20, 2026
5681837
fix(terminal): key covered rebuild panes by terminal
brennanb2025 Nov 20, 2026
782115b
perf(terminal): check atlas-rebuild visibility per due pane against v…
brennanb2025 Nov 20, 2026
0d37668
fix(terminal): give a re-armed deferred atlas a fresh retry budget
brennanb2025 Nov 20, 2026
0f6f1a4
fix(terminal): mark atlas output when xterm parses it, so a queued ta…
brennanb2025 Nov 20, 2026
1f650d4
feat(terminal): record atlas-rebuild duration in its diagnostic
brennanb2025 Nov 20, 2026
aab79c2
perf(terminal): recreate atlas-rebuild contexts one per frame
brennanb2025 Nov 20, 2026
18a5764
fix(terminal): recheck visibility and synchronized output on each def…
brennanb2025 Nov 21, 2026
6857e05
perf(terminal): rebuild a grown atlas only after its output pauses an…
brennanb2025 Nov 21, 2026
a3c55e3
fix(terminal): hold an atlas rebuild's remaining reattaches while typ…
brennanb2025 Nov 21, 2026
c9d759c
fix(terminal): drop the mid-chain typing hold, record all user PTY in…
brennanb2025 Nov 21, 2026
ae0f0b6
fix(terminal): never start an atlas rebuild mid synchronized frame, k…
brennanb2025 Nov 21, 2026
78af19d
fix(terminal): key the rebuild's grid-fit guard by terminal, so PTY s…
brennanb2025 Nov 21, 2026
a97069e
fix(terminal): count chunked standalone pastes as typing for atlas re…
brennanb2025 Nov 21, 2026
7fdea97
perf(terminal): rebuild an atlas by clearing it in place and recreati…
brennanb2025 Nov 22, 2026
18c773f
fix(terminal): decide each rebuild step on its own frame, empty every…
brennanb2025 Nov 22, 2026
09c9d41
fix(terminal): run every atlas rebuild through one weak queue, and wa…
brennanb2025 Nov 22, 2026
3251c20
fix(terminal): rotate waiting panes in the rebuild queue, start it on…
brennanb2025 Nov 22, 2026
bae82bc
fix(terminal): park atlas rebuilds while the window is hidden or unfo…
brennanb2025 Nov 22, 2026
bff3da1
fix(terminal): park atlas rebuilds while focus is in an embedded brow…
brennanb2025 Nov 22, 2026
d1f302e
fix(terminal): stop retrying an atlas whose synchronized frame never …
brennanb2025 Nov 23, 2026
f3bbeb2
fix(terminal): look at each queued rebuild pane once per frame, and k…
brennanb2025 Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { WebglAddon } from '@xterm/addon-webgl'
import type { ManagedPaneInternal } from '../pane-manager-types'
import { recordTerminalWebglDiagnostic } from '../../../../../shared/terminal/diagnostics/terminal-webgl-diagnostics'
import { getLivePaneCensus } from '../pane-manager-registry'
import { getLivePaneCensus, rebuildAllTerminalWebglRenderers } from '../pane-manager-registry'
import {
getTerminalWebglAutoDecision,
resetTerminalWebglAutoDecision
Expand Down Expand Up @@ -46,6 +46,21 @@ type XtermWebglAddonInternals = {

const panesAwaitingWebglAddon = new Set<ManagedPaneInternal>()

// A 4096² merged page means the shared atlas reached ~64 MiB; GL memory each pane's context accrued uploading it is freed only with the context (GiBs across panes).
const ATLAS_REBUILD_PAGE_SIZE = 4096
let atlasRebuildTimer: ReturnType<typeof setTimeout> | null = null

function scheduleAtlasMemoryRebuild(): void {
if (atlasRebuildTimer !== null) {
return
}
// Leave xterm's atlas callback first; the rebuild disposes renderers mid-render.
atlasRebuildTimer = setTimeout(() => {
atlasRebuildTimer = null
rebuildAllTerminalWebglRenderers('atlas-memory')
}, 0)
}

setTerminalWebglAddonLoadHandlers({
onLoaded: () => {
// Panes opened before lazy resolution retain DOM-measured grids; pair late attach with refit. attachWebgl removes its current Set entry safely during iteration.
Expand Down Expand Up @@ -276,6 +291,11 @@ export function attachWebgl(pane: ManagedPaneInternal): void {
pane.webglDisabledAfterContextLoss = true
disposeWebgl(pane, { refreshDimensions: true })
})
addon.onAddTextureAtlasCanvas((page) => {
if (page.width >= ATLAS_REBUILD_PAGE_SIZE) {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
scheduleAtlasMemoryRebuild()
}
})
pane.terminal.loadAddon(addon)
pane.webglAddon = addon
const canvas = getXtermWebglCanvas(addon)
Expand Down