mirror of
https://git.proxmox.com/git/mirror_xterm.js
synced 2025-10-04 21:16:40 +00:00
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:
parent
d20c36dff2
commit
d516d4df7c
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user