Skip to content

Commit

Permalink
fix terminal height
Browse files Browse the repository at this point in the history
  • Loading branch information
Pop John committed Oct 24, 2024
1 parent 86623c8 commit df48e55
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ export class MsTerminalXtermComponent implements OnInit, AfterViewInit, OnDestro
}

ngAfterViewInit(): void {
this.adjustHeightToParent();
this.fitTerminalToContainer();
requestAnimationFrame(() => {
this.adjustTerminalContainer();
});
}

private initializeTerminal(): void {
Expand Down Expand Up @@ -88,13 +89,13 @@ export class MsTerminalXtermComponent implements OnInit, AfterViewInit, OnDestro
this.resizeObserver.disconnect();
}
this.resizeObserver = new ResizeObserver(() => {
this.fitTerminalToContainer();
this.adjustHeightToParent();
this.adjustTerminalContainer();
});
this.resizeObserver.observe(this.terminalDiv.nativeElement);
}

private fitTerminalToContainer(): void {
private adjustTerminalContainer(): void {
this.adjustHeightToParent();
this.fitAddon.fit();
}

Expand Down

0 comments on commit df48e55

Please sign in to comment.