Skip to content

Commit 32dae68

Browse files
committed
fix bug with socketio not starting background task...?
1 parent 1e6cdd7 commit 32dae68

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pyxtermjs/app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,15 @@ def connect():
8686
app.config["child_pid"] = child_pid
8787
set_winsize(fd, 50, 50)
8888
cmd = " ".join(shlex.quote(c) for c in app.config["cmd"])
89+
# logging/print statements must go after this because... I have no idea why
90+
# but if they come before the background task never starts
91+
socketio.start_background_task(target=read_and_forward_pty_output)
92+
8993
logging.info("child pid is " + child_pid)
9094
logging.info(
9195
f"starting background task with command `{cmd}` to continously read "
9296
"and forward pty output to client"
9397
)
94-
socketio.start_background_task(target=read_and_forward_pty_output)
9598
logging.info("task started")
9699

97100

0 commit comments

Comments
 (0)