Merge branch 'master' into utf8_input

This commit is contained in:
Daniel Imms
2019-05-11 10:02:14 -07:00
committed by GitHub
8 changed files with 281 additions and 9 deletions
+7 -3
View File
@@ -21,6 +21,7 @@ import { Terminal as TerminalType, ITerminalOptions } from 'xterm';
export interface IWindowWithTerminal extends Window {
term: TerminalType;
Terminal?: typeof TerminalType;
}
declare let window: IWindowWithTerminal;
@@ -57,8 +58,6 @@ function getSearchOptions(): ISearchOptions {
};
}
createTerminal();
const disposeRecreateButtonHandler = () => {
// If the terminal exists dispose of it, otherwise recreate it
if (term) {
@@ -74,7 +73,12 @@ const disposeRecreateButtonHandler = () => {
}
};
document.getElementById('dispose').addEventListener('click', disposeRecreateButtonHandler);
if (document.location.pathname === '/test') {
window.Terminal = Terminal;
} else {
createTerminal();
document.getElementById('dispose').addEventListener('click', disposeRecreateButtonHandler);
}
function createTerminal(): void {
// Clean terminal