@volter/supercode-terminal 0.2.68 → 0.2.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +4 -0
- package/index.mjs +5 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -18,6 +18,10 @@ export type TerminalSession = Readonly<{
|
|
|
18
18
|
/** Opaque application context association; never a native harness or tmux handle. */
|
|
19
19
|
contextKey: string | null;
|
|
20
20
|
cwd: string | null;
|
|
21
|
+
/** The program has ended; a clean one-shot can finish before createSession returns. */
|
|
22
|
+
dead?: boolean;
|
|
23
|
+
/** Observed program exit status when dead, otherwise null. */
|
|
24
|
+
exitCode?: number | null;
|
|
21
25
|
id: string;
|
|
22
26
|
label: string;
|
|
23
27
|
owned: boolean;
|
package/index.mjs
CHANGED
|
@@ -698,6 +698,10 @@ export class PtyTerminalHost {
|
|
|
698
698
|
// Only closing a pane, or its daemon dying, ends a whole tree.
|
|
699
699
|
releasePane(child);
|
|
700
700
|
recordPaneExit(entry.contextKey, exitCode, signal, entry.serializer.serialize({scrollback:200}));
|
|
701
|
+
// A one-shot may finish while createSession reads the process table.
|
|
702
|
+
// Keep its observed completion for that call before forgetting the pane;
|
|
703
|
+
// a successful run is still successful when there is nothing to attach.
|
|
704
|
+
if (exitCode === 0 && !signal) entry.finished = this.#describe(entry, null);
|
|
701
705
|
this.#tellExit(entry);
|
|
702
706
|
this.#writeWatchList();
|
|
703
707
|
if (exitCode === 0) this.#forget(entry);
|
|
@@ -715,6 +719,7 @@ export class PtyTerminalHost {
|
|
|
715
719
|
// after it happens (it flushes the output first), so a root missing from the table is waited on.
|
|
716
720
|
else if (table) await Promise.race([settled, sleep(3_000)]);
|
|
717
721
|
if (!this.#sessions.has(id)) {
|
|
722
|
+
if (entry.finished) return entry.finished;
|
|
718
723
|
throw new TerminalHostError('session_not_found', `${input.command.program} exited before its pane could be attached.`);
|
|
719
724
|
}
|
|
720
725
|
this.#writeWatchList();
|