Add theme support

This commit is contained in:
Daniel Imms
2017-09-01 15:50:18 -07:00
parent 076156b66e
commit 62fea4d3ed
13 changed files with 278 additions and 181 deletions
+8 -1
View File
@@ -39,7 +39,7 @@ import * as Mouse from './utils/Mouse';
import { CHARSETS } from './Charsets';
import { getRawByteCoords } from './utils/Mouse';
import { CustomKeyEventHandler, Charset, LinkMatcherHandler, LinkMatcherValidationCallback, CharData, LineData } from './Types';
import { ITerminal, IBrowser, ITerminalOptions, IInputHandlingTerminal, ILinkMatcherOptions, IViewport, ICompositionHelper } from './Interfaces';
import { ITerminal, IBrowser, ITerminalOptions, IInputHandlingTerminal, ILinkMatcherOptions, IViewport, ICompositionHelper, ITheme } from './Interfaces';
import { BellSound } from './utils/Sounds';
// Declare for RequireJS in loadAddon
@@ -412,6 +412,13 @@ export class Terminal extends EventEmitter implements ITerminal, IInputHandlingT
this.textarea.focus();
}
public setTheme(theme: ITheme): void {
// TODO: Allow setting of theme before renderer is ready
if (this.renderer) {
this.renderer.setTheme(theme);
}
}
/**
* Retrieves an option's value from the terminal.
* @param {string} key The option key.