Skip to content

Commit

Permalink
fix(terminal): fix duplicated messages on terminal change
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Jul 4, 2021
1 parent 7a0b7cc commit 6469c81
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ const themes: { [key: string]: ITheme } = {
blue: '#3b62d9',
magenta: '#a431c4',
cyan: '#178262',
white: '#d69e2e',
white: '#615f51',
brightBlack: '#0e0e0c',
brightRed: '#b72424',
brightGreen: '#4b862c',
brightYellow: '#d69e2e',
brightBlue: '#3b62d9',
brightMagenta: '#a431c4',
brightCyan: '#178262',
brightWhite: '#d69e2e',
brightWhite: '#615f51',
cursor: 'rgba(0, 0, 0, 0)',
cursorAccent: 'rgba(0, 0, 0, 0)',
selection: 'rgba(0, 0, 0, 0.1)'
Expand Down Expand Up @@ -122,9 +122,10 @@ export class TerminalComponent implements OnInit, OnDestroy, OnChanges {

if ('theme' in changes) {
this.setTheme();
this.fitAddon.fit();
}

if (!this.data) {
if (!changes.data || !this.data) {
return;
}

Expand All @@ -134,8 +135,7 @@ export class TerminalComponent implements OnInit, OnDestroy, OnChanges {
return;
}

this.terminal.write(this.data);
this.fitAddon.fit();
this.terminal.write(this.data, () => this.fitAddon.fit());
}

ngOnDestroy(): void {
Expand Down

0 comments on commit 6469c81

Please sign in to comment.