mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-10-25 07:06:42 +00:00
Amended some default styling/befavior
- cursorBlink is not default from now on - added some custom behavior in the demo
This commit is contained in:
parent
0ae4b803cf
commit
7a6fb27a53
22
demo/main.js
22
demo/main.js
@ -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);
|
||||
}
|
||||
});
|
||||
@ -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;
|
||||
}
|
||||
@ -41,3 +41,7 @@
|
||||
outline: none;
|
||||
font-family: courier-new, courier, monospace;
|
||||
}
|
||||
|
||||
.terminal .terminal-cursor {
|
||||
background-color: #fff;
|
||||
}
|
||||
@ -389,7 +389,7 @@ Terminal.defaults = {
|
||||
convertEol: false,
|
||||
termName: 'xterm',
|
||||
geometry: [80, 24],
|
||||
cursorBlink: true,
|
||||
cursorBlink: false,
|
||||
visualBell: false,
|
||||
popOnBell: false,
|
||||
scrollback: 1000,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user