| 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 | } |