diff --git a/index.php b/index.php index 569a3e1..2e82d0b 100644 --- a/index.php +++ b/index.php @@ -2,6 +2,7 @@
+ @@ -19,15 +20,20 @@ window.onresize = function() { changeFrameHeight(); } + document.onkeydown = function(e) { //对整个页面监听 + var keyNum = window.event ? e.keyCode : e.which; + if (keyNum == 13) { + document.getElementById("fm").submit(); + document.getElementById("command").value = ""; + } + } - - diff --git a/terminal.php b/terminal.php index 0c3c3c5..0ed826a 100644 --- a/terminal.php +++ b/terminal.php @@ -28,16 +28,16 @@ if(!opendir("fileroot")){ ", FILE_APPEND); + $commands = explode(" ", $_POST['command']); + file_put_contents("recent.txt", $pwd . " $ " . $commands[0] . "