Amended some default styling/befavior

- cursorBlink is not default from now on
- added some custom behavior in the demo
This commit is contained in:
paris 2014-03-24 16:53:33 +00:00
parent 0ae4b803cf
commit 7a6fb27a53
4 changed files with 30 additions and 4 deletions

View File

@ -1,8 +1,24 @@
var terminalContainer = document.getElementById('terminal-container'),
term = new Terminal({geometry: [60, 37]});
term = new Terminal({geometry: [95, 37]});
term.prompt = function () {
term.write('> ');
}
term.open(terminalContainer);
term.writeln('Welcome to xterm.js');
term.writeln('Just type some keys in the prompt below.');
term.writeln('');
term.prompt();
term.on('data', function (data) {
term.write(data);
term.on('key', function (key, ev) {
console.log(this, key, ev);
if (ev.keyIdentifier == 'Enter') {
term.writeln('');
term.prompt();
} if (ev.keyCode == 8) {
term.write('\b \b');
}else {
term.write(key);
}
});

View File

@ -12,9 +12,15 @@ h1 {
width: 960px;
height: 600px;
margin: 0 auto;
padding: 2px;
}
#terminal-container .terminal {
background-color: #111;
color: #fafafa;
padding: 2px;
}
#terminal-container .terminal .terminal-cursor {
background-color: #fafafa;
}

View File

@ -40,4 +40,8 @@
color: #fff;
outline: none;
font-family: courier-new, courier, monospace;
}
.terminal .terminal-cursor {
background-color: #fff;
}

View File

@ -389,7 +389,7 @@ Terminal.defaults = {
convertEol: false,
termName: 'xterm',
geometry: [80, 24],
cursorBlink: true,
cursorBlink: false,
visualBell: false,
popOnBell: false,
scrollback: 1000,