Skip to content

Commit

Permalink
Update terminal font family as soon as its updated
Browse files Browse the repository at this point in the history
Fixes #6726
  • Loading branch information
Tyriar committed May 27, 2016
1 parent 20f73da commit 3fde039
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,28 +209,35 @@ export class TerminalPanel extends Panel {
}
}));
this.toDispose.push(this.themeService.onDidThemeChange((themeId) => {
this.setTerminalTheme(themeId);
this.setTerminalTheme();
}));
this.toDispose.push(this.configurationService.onDidUpdateConfiguration((e) => {
this.setTerminalFont();
}));

this.terminal.open(this.terminalDomElement);
this.parentDomElement.appendChild(terminalScrollbar.getDomNode());

let config = this.configurationService.getConfiguration<ITerminalConfiguration>();
this.terminalDomElement.style.fontFamily = config.terminal.integrated.fontFamily;
this.setTerminalTheme(this.themeService.getTheme());
this.setTerminalFont();
this.setTerminalTheme();
resolve(void 0);
});
}

private setTerminalTheme(themeId: string) {
private setTerminalTheme() {
if (!this.terminal) {
return;
}
let baseThemeId = getBaseThemeId(themeId);
let baseThemeId = getBaseThemeId(this.themeService.getTheme());
this.terminal.colors = DEFAULT_ANSI_COLORS[baseThemeId];
this.terminal.refresh(0, this.terminal.rows);
}

private setTerminalFont() {
let config = this.configurationService.getConfiguration<ITerminalConfiguration>();
this.terminalDomElement.style.fontFamily = config.terminal.integrated.fontFamily;
}

public focus(): void {
this.focusTerminal(true);
}
Expand Down

0 comments on commit 3fde039

Please sign in to comment.