Skip to content

Commit

Permalink
Check to make sure cols & rows are INT
Browse files Browse the repository at this point in the history
I've noticed that if the terminal is hidden and the screen experiences a resize trigger from a blur / focus, it can cause the dimensions to be undefined.  This creates an exception in Xterm.js that the values are not integers.  Figured it would be ok to just check before doing a resize.
  • Loading branch information
eljeffeg authored Oct 26, 2021
1 parent 394d7a2 commit 5c9adee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/xterm-addon-fit/src/FitAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class FitAddon implements ITerminalAddon {

public fit(): void {
const dims = this.proposeDimensions();
if (!dims || !this._terminal) {
if (!dims || !this._terminal || isNaN(dims.cols) || isNaN(dims.rows)) {
return;
}

Expand Down

0 comments on commit 5c9adee

Please sign in to comment.