mirror of
https://github.com/sigmasternchen/webcli
synced 2025-03-15 22:28:54 +00:00
we _have_ to return in handleKey if a program is running. otherwise the shell copys every into to prompt
This commit is contained in:
parent
81f2624ab1
commit
9bd7da0829
1 changed files with 5 additions and 1 deletions
|
@ -86,8 +86,9 @@ Shell.prototype.displayPrompt = function() {
|
||||||
this.output("\033[2K\033[1G" + text + this.input + "\033[" + (this.input.length - this.inputPosition) + "D");
|
this.output("\033[2K\033[1G" + text + this.input + "\033[" + (this.input.length - this.inputPosition) + "D");
|
||||||
}
|
}
|
||||||
Shell.prototype.handleKey = function(keyEvent) {
|
Shell.prototype.handleKey = function(keyEvent) {
|
||||||
if (this.porgram) {
|
if (this.program) {
|
||||||
this.program.handleKey(keyEvent);
|
this.program.handleKey(keyEvent);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
if (keyEvent.isSpecialKey) {
|
if (keyEvent.isSpecialKey) {
|
||||||
var ke = KeyEvent.SpecialKeys;
|
var ke = KeyEvent.SpecialKeys;
|
||||||
|
@ -150,6 +151,9 @@ Shell.prototype.handleKey = function(keyEvent) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Shell.prototype.exec = function() {
|
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(" ");
|
var args = this.input.split(" ");
|
||||||
this.input = "";
|
this.input = "";
|
||||||
this.inputPosition = 0;
|
this.inputPosition = 0;
|
||||||
|
|
Loading…
Reference in a new issue