You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# DF8206: Terminal Session Restart on Closed Stream
6
+
7
+
## Message
8
+
9
+
> Terminal session "`{id}`" cannot be restarted — its output stream is already closed
10
+
11
+
## Cause
12
+
13
+
`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.
14
+
15
+
## Fix
16
+
17
+
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.
18
+
19
+
## Source
20
+
21
+
-[`packages/hub/src/node/host-terminals.ts`](https://github.com/devframes/devframe/blob/main/packages/hub/src/node/host-terminals.ts) — the `restart()` handle returned by `startChildProcess()` and `startPtySession()` throws this once the session's stream has closed.
why: (p: {id: string})=>`Terminal session "${p.id}" is not restartable`,
68
68
fix: 'It was registered with `restartable: false`; restart it through its owner\'s controls, or spawn it with `restartable: true` (the default) to allow in-place restarts.',
69
69
},
70
+
DF8206: {
71
+
why: (p: {id: string})=>`Terminal session "${p.id}" cannot be restarted — its output stream is already closed`,
72
+
fix: 'The session already exited (or was terminated) and its stream is spent. Drop it with `ctx.terminals.remove(session)`, then spawn a replacement via `ctx.terminals.startChildProcess()` or `ctx.terminals.startPtySession()` with a fresh id.',
73
+
},
70
74
DF8400: {
71
75
why: (p: {id: string})=>`Command "${p.id}" is already registered`,
/** Throws `DF8206` once the session's output stream has closed (after a natural exit or `terminate()`) — drop it with `ctx.terminals.remove(session)` and start a fresh session instead. */
/** Current foreground process name, when the backend can resolve it. */
140
141
getProcessName: ()=>string|undefined
141
142
terminate: ()=>Promise<void>
143
+
/** Throws `DF8206` once the session's output stream has closed (after a natural exit or `terminate()`) — drop it with `ctx.terminals.remove(session)` and start a fresh session instead. */
0 commit comments