1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Merge branch 'master' into master

This commit is contained in:
catborise 2023-11-10 16:35:51 +03:00 committed by GitHub
commit 296081d1e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 167 additions and 240 deletions

View file

@ -176,7 +176,7 @@ def connect(sid, environ):
if child_pid:
# already started child process, don't start another
# write a new line so that when a client refresh the shell prompt is printed
fd.write("\n")
os.write(fd, str.encode("\n"))
return
# create child process attached to a pty we can read from and write to
@ -200,8 +200,13 @@ def disconnect(sid):
global child_pid
# kill pty process
os.kill(child_pid, signal.SIGKILL)
os.wait()
try:
os.kill(child_pid, signal.SIGKILL)
os.wait()
except ProcessLookupError:
pass
except ChildProcessError:
pass
# reset the variables
fd = None