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
+4
View File
@@ -16,6 +16,10 @@ function startServer() {
res.sendFile(__dirname + '/index.html');
});
app.get('/test', function(req, res){
res.sendFile(__dirname + '/test.html');
});
app.get('/style.css', function(req, res){
res.sendFile(__dirname + '/style.css');
});
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html>
<head>
<title>xterm.js integration test fixture</title>
<link rel="stylesheet" href="/src/xterm.css" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="terminal-container"></div>
<script src="dist/client-bundle.js" defer ></script>
</body>
</html>