Skip to content

Commit 0fbc71b

Browse files
javier-godoypaodb
authored andcommitted
fix: fix FitAddon behavior
1 parent d5b5182 commit 0fbc71b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main/resources/META-INF/frontend/fc-xterm/xterm-fit-mixin.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ class FitAddon extends FitAddonBase {
3030
_disposables : IDisposable[];
3131
$ : FitMixin;
3232

33+
constructor() {
34+
super();
35+
const super_fit = this.fit.bind(this);
36+
this.fit = () => {
37+
super_fit();
38+
this.__unsetWidth();
39+
requestAnimationFrame(()=>this.__unsetWidth());
40+
};
41+
}
42+
43+
__unsetWidth() {
44+
(this.$.node.terminal as any)._core.viewport._viewportElement.style.width='unset';
45+
}
46+
3347
activate(terminal: Terminal): void {
3448
super.activate(terminal);
3549

0 commit comments

Comments
 (0)