MCPcopy Index your code
hub / github.com/codeaashu/claude-code / constructor

Method constructor

src/server/web/public/terminal.js:7028–7045  ·  view source on GitHub ↗
(e3, t3, i3, n2, d2, u2, g2, v2, C2)

Source from the content-addressed store, hash-verified

7026 };
7027 }, 666: (e2, t2, i2) => {
7028 Object.defineProperty(t2, "__esModule", { value: true }), t2.JoinedCellData = t2.WebglRenderer = void 0;
7029 const s2 = i2(820), r = i2(274), o = i2(627), n = i2(457), a = i2(56), h = i2(374), l = i2(345), c = i2(859), d = i2(147), _ = i2(782), u = i2(855), g = i2(965), v = i2(742), f = i2(310), p = i2(733);
7030 class C extends c.Disposable {
7031 constructor(e3, t3, i3, n2, d2, u2, g2, v2, C2) {
7032 super(), this._terminal = e3, this._characterJoinerService = t3, this._charSizeService = i3, this._coreBrowserService = n2, this._coreService = d2, this._decorationService = u2, this._optionsService = g2, this._themeService = v2, this._cursorBlinkStateManager = new c.MutableDisposable(), this._charAtlasDisposable = this.register(new c.MutableDisposable()), this._observerDisposable = this.register(new c.MutableDisposable()), this._model = new f.RenderModel(), this._workCell = new _.CellData(), this._workCell2 = new _.CellData(), this._rectangleRenderer = this.register(new c.MutableDisposable()), this._glyphRenderer = this.register(new c.MutableDisposable()), this._onChangeTextureAtlas = this.register(new l.EventEmitter()), this.onChangeTextureAtlas = this._onChangeTextureAtlas.event, this._onAddTextureAtlasCanvas = this.register(new l.EventEmitter()), this.onAddTextureAtlasCanvas = this._onAddTextureAtlasCanvas.event, this._onRemoveTextureAtlasCanvas = this.register(new l.EventEmitter()), this.onRemoveTextureAtlasCanvas = this._onRemoveTextureAtlasCanvas.event, this._onRequestRedraw = this.register(new l.EventEmitter()), this.onRequestRedraw = this._onRequestRedraw.event, this._onContextLoss = this.register(new l.EventEmitter()), this.onContextLoss = this._onContextLoss.event, this.register(this._themeService.onChangeColors((() => this._handleColorChange()))), this._cellColorResolver = new r.CellColorResolver(this._terminal, this._optionsService, this._model.selection, this._decorationService, this._coreBrowserService, this._themeService), this._core = this._terminal._core, this._renderLayers = [new p.LinkRenderLayer(this._core.screenElement, 2, this._terminal, this._core.linkifier, this._coreBrowserService, g2, this._themeService)], this.dimensions = (0, h.createRenderDimensions)(), this._devicePixelRatio = this._coreBrowserService.dpr, this._updateDimensions(), this._updateCursorBlink(), this.register(g2.onOptionChange((() => this._handleOptionsChanged()))), this._canvas = this._coreBrowserService.mainDocument.createElement("canvas");
7033 const m2 = { antialias: false, depth: false, preserveDrawingBuffer: C2 };
7034 if (this._gl = this._canvas.getContext("webgl2", m2), !this._gl) throw new Error("WebGL2 not supported " + this._gl);
7035 this.register((0, s2.addDisposableDomListener)(this._canvas, "webglcontextlost", ((e4) => {
7036 console.log("webglcontextlost event received"), e4.preventDefault(), this._contextRestorationTimeout = setTimeout((() => {
7037 this._contextRestorationTimeout = void 0, console.warn("webgl context not restored; firing onContextLoss"), this._onContextLoss.fire(e4);
7038 }), 3e3);
7039 }))), this.register((0, s2.addDisposableDomListener)(this._canvas, "webglcontextrestored", ((e4) => {
7040 console.warn("webglcontextrestored event received"), clearTimeout(this._contextRestorationTimeout), this._contextRestorationTimeout = void 0, (0, o.removeTerminalFromCache)(this._terminal), this._initializeWebGLState(), this._requestRedrawViewport();
7041 }))), this._observerDisposable.value = (0, a.observeDevicePixelDimensions)(this._canvas, this._coreBrowserService.window, ((e4, t4) => this._setCanvasDevicePixelDimensions(e4, t4))), this.register(this._coreBrowserService.onWindowChange(((e4) => {
7042 this._observerDisposable.value = (0, a.observeDevicePixelDimensions)(this._canvas, e4, ((e5, t4) => this._setCanvasDevicePixelDimensions(e5, t4)));
7043 }))), this._core.screenElement.appendChild(this._canvas), [this._rectangleRenderer.value, this._glyphRenderer.value] = this._initializeWebGLState(), this._isAttached = this._coreBrowserService.window.document.body.contains(this._core.screenElement), this.register((0, c.toDisposable)((() => {
7044 var _a;
7045 for (const e4 of this._renderLayers) e4.dispose();
7046 (_a = this._canvas.parentElement) == null ? void 0 : _a.removeChild(this._canvas), (0, o.removeTerminalFromCache)(this._terminal);
7047 })));
7048 }

Callers

nothing calls this directly

Calls 13

_handleColorChangeMethod · 0.95
_updateDimensionsMethod · 0.95
_updateCursorBlinkMethod · 0.95
_handleOptionsChangedMethod · 0.95
_initializeWebGLStateMethod · 0.95
preventDefaultMethod · 0.80
fireMethod · 0.80
disposeMethod · 0.65
registerMethod · 0.45
warnMethod · 0.45

Tested by

no test coverage detected