MCPcopy Create free account
hub / github.com/codeaashu/claude-code / proposeDimensions

Method proposeDimensions

src/server/web/public/terminal.js:6177–6184  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6175 const e2 = this.proposeDimensions();
6176 if (!e2 || !this._terminal || isNaN(e2.cols) || isNaN(e2.rows)) return;
6177 const t2 = this._terminal._core;
6178 this._terminal.rows === e2.rows && this._terminal.cols === e2.cols || (t2._renderService.clear(), this._terminal.resize(e2.cols, e2.rows));
6179 }
6180 proposeDimensions() {
6181 if (!this._terminal) return;
6182 if (!this._terminal.element || !this._terminal.element.parentElement) return;
6183 const e2 = this._terminal._core, t2 = e2._renderService.dimensions;
6184 if (0 === t2.css.cell.width || 0 === t2.css.cell.height) return;
6185 const r = 0 === this._terminal.options.scrollback ? 0 : e2.viewport.scrollBarWidth, i = window.getComputedStyle(this._terminal.element.parentElement), o = parseInt(i.getPropertyValue("height")), s = Math.max(0, parseInt(i.getPropertyValue("width"))), n = window.getComputedStyle(this._terminal.element), l = o - (parseInt(n.getPropertyValue("padding-top")) + parseInt(n.getPropertyValue("padding-bottom"))), a = s - (parseInt(n.getPropertyValue("padding-right")) + parseInt(n.getPropertyValue("padding-left"))) - r;
6186 return { cols: Math.max(2, Math.floor(a / t2.css.cell.width)), rows: Math.max(1, Math.floor(l / t2.css.cell.height)) };
6187 }

Callers 1

fitMethod · 0.80

Calls 1

maxMethod · 0.80

Tested by

no test coverage detected