提交 4d4c26c6 编写于 作者: D Daniel Imms

Add some safeguards to prevent term crashes

上级 c46cb073
......@@ -217,6 +217,9 @@ export class TerminalPanel extends Panel {
}
private setTerminalTheme(themeId: string) {
if (!this.terminal) {
return;
}
let baseThemeId = getBaseThemeId(themeId);
this.terminal.colors = DEFAULT_ANSI_COLORS[baseThemeId];
this.terminal.refresh(0, this.terminal.rows);
......@@ -227,6 +230,9 @@ export class TerminalPanel extends Panel {
}
private focusTerminal(force?: boolean): void {
if (!this.terminal) {
return;
}
let text = window.getSelection().toString();
if (!text || force) {
this.terminal.focus();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册