Terminal / app /static /js /terminal.js
goingyt's picture
Create app/static/js/terminal.js
402d195 verified
raw
history blame
703 Bytes
document.addEventListener('DOMContentLoaded', function() {
const input = document.getElementById('terminal-input');
const output = document.getElementById('terminal-output');
input.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
const command = input.value;
output.innerHTML += `<div><span class="prompt">$</span> ${command}</div>`;
// Add basic command handling here
if (command === 'clear') {
output.innerHTML = '';
} else {
output.innerHTML += `<div>Command not found: ${command}</div>`;
}
input.value = '';
}
});
});