diff --git a/terminal.php b/terminal.php index 51cd263..849177c 100644 --- a/terminal.php +++ b/terminal.php @@ -59,8 +59,11 @@ sendCmd = function(command) { // OK reponse? if (xhr.status==200) { // Set the output to also include our response and scroll down to bottom - document.getElementById('output').innerHTML += xhr.responseText; - document.body.scrollTop = document.body.scrollHeight; + var newOutput = document.createElement("DIV"); + newOutput.innerHTML = xhr.responseText; + var cmdElem = document.getElementById("commandLine"); + cmdElem.parentNode.insertBefore(newOutput, cmdElem); + top.document.getElementById("terminal").contentWindow.document.documentElement.scrollTop = document.getElementById('output').scrollHeight; // Add command onto end of history array or set as last item in array if (currentLine == 0 || commandHistory[commandHistory.length-1].indexOf("[[ICEcoder]]:") !== 0) { @@ -91,17 +94,13 @@ $cwd = $ICEcoder['docRoot'].$ICEcoder['root']; Close X