Skip to content

Commit

Permalink
fixed #7288 - resize PTY when zooming in/out
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Oct 25, 2022
1 parent 0ea2adf commit d3982f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tabby-terminal/src/frontends/xtermFrontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ export class XTermFrontend extends Frontend {
setZoom (zoom: number): void {
this.zoom = zoom
this.setFontSize()
this.resizeHandler()
}

private getSearchOptions (searchOptions?: SearchOptions): ISearchOptions {
Expand Down Expand Up @@ -474,7 +475,7 @@ export class XTermFrontend extends Frontend {
const scale = Math.pow(1.1, this.zoom)
this.xterm.options.fontSize = this.configuredFontSize * scale
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
this.xterm.options.lineHeight = (this.configuredFontSize + this.configuredLinePadding * 2) / this.configuredFontSize * scale
this.xterm.options.lineHeight = Math.max(1, (this.configuredFontSize + this.configuredLinePadding * 2) / this.configuredFontSize * scale)
this.resizeHandler()
}

Expand Down

0 comments on commit d3982f5

Please sign in to comment.