fix: ttyd dies immediately — add start_new_session=True to subprocess spawn
Without start_new_session=True, ttyd inherits the parent's process group and gets cleaned up when the asyncio transport is garbage collected after the HTTP handler completes. start_new_session=True detaches ttyd into its own process group so it survives independently of the parent.
This commit is contained in:
@@ -213,6 +213,7 @@ async def spawn_ttyd(session_name: str) -> asyncio.subprocess.Process:
|
||||
session_name,
|
||||
stdout=asyncio.subprocess.DEVNULL,
|
||||
stderr=asyncio.subprocess.DEVNULL,
|
||||
start_new_session=True, # detach from parent process group so ttyd survives independently
|
||||
)
|
||||
|
||||
# Write PID file (create parent dirs if needed)
|
||||
|
||||
Reference in New Issue
Block a user