Remove debug messages from terminal output

parent ff832032
...@@ -200,7 +200,6 @@ def connect_terminal(client_id): ...@@ -200,7 +200,6 @@ def connect_terminal(client_id):
# Start a thread to read output # Start a thread to read output
output_buffer = [] output_buffer = []
def read_output(): def read_output():
output_buffer.append('Process started, reading output...\r\n')
while proc.poll() is None: while proc.poll() is None:
r, w, e = select.select([master], [], [], 0.1) r, w, e = select.select([master], [], [], 0.1)
if master in r: if master in r:
...@@ -218,14 +217,12 @@ def connect_terminal(client_id): ...@@ -218,14 +217,12 @@ def connect_terminal(client_id):
data = os.read(master, 1024) data = os.read(master, 1024)
except: except:
pass pass
output_buffer.append('\r\nProcess finished.\r\n')
os.close(master) os.close(master)
thread = threading.Thread(target=read_output, daemon=True) thread = threading.Thread(target=read_output, daemon=True)
thread.start() thread.start()
if proc.poll() is not None: # Process status will be checked in the reading thread
output_buffer.append(f'\r\nProcess failed to start, exit code: {proc.returncode}\r\n')
active_terminals[request_id] = {'client_id': client_id, 'username': username, 'proc': proc, 'output_buffer': output_buffer, 'master': master} active_terminals[request_id] = {'client_id': client_id, 'username': username, 'proc': proc, 'output_buffer': output_buffer, 'master': master}
return jsonify({'request_id': request_id, 'command': ' '.join(command)}) return jsonify({'request_id': request_id, 'command': ' '.join(command)})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment