Skip to content

DF8206: Terminal Session Restart on Closed Stream

Message

Terminal session "{id}" cannot be restarted — its output stream is already closed

Cause

restart() was called on a startChildProcess() or startPtySession() session whose output stream is already closed. The stream closes irreversibly on a natural process exit or after terminate() — it backs a single-use ReadableStream controller that cannot be reopened, so restarting in place is not possible once it has closed.

Fix

Drop the spent session with ctx.terminals.remove(session), then spawn a replacement via ctx.terminals.startChildProcess() or ctx.terminals.startPtySession() with a fresh id.

Source

Released under the MIT License.