we _have_ to return in handleKey if a program is running. otherwise the shell copys every into to prompt

This commit is contained in:
overflowerror 2014-08-16 21:03:53 +02:00
parent 81f2624ab1
commit 9bd7da0829

View file

@ -86,8 +86,9 @@ Shell.prototype.displayPrompt = function() {
this.output("\033[2K\033[1G" + text + this.input + "\033[" + (this.input.length - this.inputPosition) + "D");
}
Shell.prototype.handleKey = function(keyEvent) {
if (this.porgram) {
if (this.program) {
this.program.handleKey(keyEvent);
return;
}
if (keyEvent.isSpecialKey) {
var ke = KeyEvent.SpecialKeys;
@ -150,6 +151,9 @@ Shell.prototype.handleKey = function(keyEvent) {
}
}
Shell.prototype.exec = function() {
var request = new Request("backend/command.php");
request.setData([["command", this.input]]);
request.send(false, ret);
var args = this.input.split(" ");
this.input = "";
this.inputPosition = 0;