mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Catch xtermjs fit error (#1907)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
parent
2543e4aec7
commit
02bc210f56
@ -130,10 +130,17 @@ export class Terminal {
|
|||||||
fit = () => {
|
fit = () => {
|
||||||
// Since this function is debounced we need to read this value as late as possible
|
// Since this function is debounced we need to read this value as late as possible
|
||||||
if (!this.isActive) return;
|
if (!this.isActive) return;
|
||||||
|
|
||||||
|
try {
|
||||||
this.fitAddon.fit();
|
this.fitAddon.fit();
|
||||||
const { cols, rows } = this.xterm;
|
const { cols, rows } = this.xterm;
|
||||||
|
|
||||||
this.api.sendTerminalSize(cols, rows);
|
this.api.sendTerminalSize(cols, rows);
|
||||||
|
} catch(error) {
|
||||||
|
console.error(error);
|
||||||
|
|
||||||
|
return; // see https://github.com/lensapp/lens/issues/1891
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
fitLazy = debounce(this.fit, 250);
|
fitLazy = debounce(this.fit, 250);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user