xterm.js : fitAddon.fit() throws ERROR Error: This API only accepts integers

102 views Asked by At

Scenario : on button click, I hit window.open to open new tab in browser where I used the xterm.js inside the component in angular.

Problem : ERROR Error: This API only accepts integers

code :

ngOnInit() { 
this.terminal = new Terminal(this.baseTerminalOptions)
this.terminal?.loadAddon(this.fitAddon);
}

ngAfterViewInint() {
this.terminal?.open(this.terminalWrapper.nativeElement);
    this.fitAddon?.fit(); // problem line in console
    this.terminal.writeln('enter something in web-ssh-shell \n \r');
}
Angular 14
"xterm": "4.4.0",
"xterm-addon-fit": "0.3.0"

expecting it to render the terminal without any error.

0

There are 0 answers