css decide
This commit is contained in:
@@ -13,25 +13,6 @@ terminal_bp = Blueprint('terminal', __name__, url_prefix='/vsc-like')
|
||||
# 存储终端进程
|
||||
terminals = {}
|
||||
|
||||
def start_terminal_process(socket_id):
|
||||
# 启动一个 bash 终端
|
||||
process = subprocess.Popen(
|
||||
['bash'],
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
text=True
|
||||
)
|
||||
|
||||
# 监听进程的输出
|
||||
while True:
|
||||
output = process.stdout.readline()
|
||||
if output:
|
||||
emit('terminal_output', {'data': output}, room=socket_id)
|
||||
if process.poll() is not None:
|
||||
break
|
||||
|
||||
|
||||
def start_terminal_process(socket_id):
|
||||
"""
|
||||
监听多个子进程的输出,并通过 WebSocket 发给前端
|
||||
|
||||
Reference in New Issue
Block a user