]> git.proxmox.com Git - mirror_xterm.js.git/blame - demo/main.js
Started implementing theming.
[mirror_xterm.js.git] / demo / main.js
CommitLineData
c5ae1cea 1var terminalContainer = document.getElementById('terminal-container'),
3d680e1c
PK
2 term = new Terminal({
3 geometry: [95, 37],
4 theme: 'crazy'
5 });
7a6fb27a
PK
6
7term.prompt = function () {
8 term.write('> ');
9}
c5ae1cea
PK
10
11term.open(terminalContainer);
7a6fb27a
PK
12term.writeln('Welcome to xterm.js');
13term.writeln('Just type some keys in the prompt below.');
14term.writeln('');
15term.prompt();
c5ae1cea 16
7a6fb27a 17term.on('key', function (key, ev) {
7a6fb27a
PK
18 if (ev.keyIdentifier == 'Enter') {
19 term.writeln('');
20 term.prompt();
21 } if (ev.keyCode == 8) {
22 term.write('\b \b');
23 }else {
24 term.write(key);
25 }
c5ae1cea 26});