Update main.js

just a tiny change, if you are using the demo file as example to start working with, prompt as variable might cause trouble if you do use prompt() rather use shellprompt as variable name instead of prompt. I'd suggest to rename term's prompt() as well to not cause confusion.
This commit is contained in:
Jean Bruenn 2015-09-08 14:08:44 +02:00
parent d20c36dff2
commit d516d4df7c

View File

@ -1,12 +1,12 @@
var terminalContainer = document.getElementById('terminal-container'),
term = new Terminal(),
prompt = '> ';
shellprompt = '> ';
term.open(terminalContainer);
term.fit();
term.prompt = function () {
term.write('\r\n' + prompt);
term.write('\r\n' + shellprompt);
};
term.writeln('Welcome to xterm.js');
@ -29,4 +29,4 @@ term.on('key', function (key, ev) {
} else if (printable) {
term.write(key);
}
});
});