ent = text; out.appendChild(line); out.scrollTop = out.scrollHeight; } function termKeydown(e) { if (e.key === 'Enter') { runCmd(); return; } if (e.key === 'ArrowUp') { e.preventDefault(); if (histIdx < cmdHistory.length - 1) { histIdx++; document.getElementById('termInput').value = cmdHistory[histIdx]; } } if (e.key === 'ArrowDown') { e.preventDefault(); if (histIdx > 0) { histIdx--; document.getElementById('termInput').value = cmdHistory[histIdx]; } else { histIdx = -1; document.getElementById('termInput').value = ''; } } if (e.key === 'l' && e.ctrlKey) { e.preventDefault(); clearTerm(); } } // Init go(curPath);