Skip to content

Commit c549823

Browse files
committed
fix(gritty) client: throw when minimized
1 parent 66553a0 commit c549823

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

client/gritty.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ require('xterm/css/xterm.css');
55
const {FitAddon} = require('xterm-addon-fit');
66
const {WebglAddon} = require('xterm-addon-webgl');
77
const currify = require('currify');
8+
const tryCatch = require('try-catch');
89

910
const getEl = require('./get-el');
1011
const getHost = require('./get-host');
@@ -114,7 +115,10 @@ function _onTermData(socket, data) {
114115
}
115116

116117
function _onWindowResize(fitAddon) {
117-
fitAddon.fit();
118+
// Uncaught Error: This API only accepts integers
119+
// when gritty mimized
120+
const fit = fitAddon.fit.bind(fitAddon);
121+
tryCatch(fit);
118122
}
119123

120124
function connect(prefix, socketPath) {

0 commit comments

Comments
 (0)