goingyt commited on
Commit
599878e
Β·
verified Β·
1 Parent(s): fafa3f8

Update app/static/js/terminal.js

Browse files
Files changed (1) hide show
  1. app/static/js/terminal.js +2 -0
app/static/js/terminal.js CHANGED
@@ -7,12 +7,14 @@ document.addEventListener('DOMContentLoaded', function() {
7
  if (e.key === 'Enter') {
8
  const command = input.value;
9
  output.innerHTML += `<div><span class="prompt">$</span> ${command}</div>`;
 
10
  socket.emit('input', {command: command});
11
  input.value = '';
12
  }
13
  });
14
 
15
  socket.on('output', function(data) {
 
16
  output.innerHTML += `<div>${data.output}</div>`;
17
  });
18
  });
 
7
  if (e.key === 'Enter') {
8
  const command = input.value;
9
  output.innerHTML += `<div><span class="prompt">$</span> ${command}</div>`;
10
+ console.log(`Sending command: ${command}`); // Debugging log
11
  socket.emit('input', {command: command});
12
  input.value = '';
13
  }
14
  });
15
 
16
  socket.on('output', function(data) {
17
+ console.log(`Received output: ${data.output}`); // Debugging log
18
  output.innerHTML += `<div>${data.output}</div>`;
19
  });
20
  });