@volter/supercode-terminal 0.2.68 → 0.2.70

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.
Files changed (3) hide show
  1. package/index.d.ts +4 -0
  2. package/index.mjs +10 -1
  3. 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();
@@ -1903,7 +1908,11 @@ export function composerText(kind, screen) {
1903
1908
  // the live bottom (model/cwd and shortcuts can occupy separate rows).
1904
1909
  if (kind === 'codex' && (plain.slice(end + 1).some((line) => line.trim() && !footer.test(line)) ||
1905
1910
  /\bmodel:\s+loading\b/iu.test(plain.findLast((line) => /\bmodel:/iu.test(line)) ?? ''))) return null;
1906
- if (kind === 'claude-code' && (row === 0 || !rule.test(plain[row - 1]))) return null;
1911
+ if (kind === 'claude-code' && (row === 0 || !rule.test(plain[row - 1]) ||
1912
+ // Prompt-history search keeps the editor's caret and enclosing rules,
1913
+ // but its input is a search query. Its live footer can wrap on a narrow
1914
+ // pane; inspect only rows below this editor, never transcript text.
1915
+ /(?:^|\n)\s*search\s+prompts\s*:/iu.test(plain.slice(end + 1).join('\n')))) return null;
1907
1916
  const first = plain[row].match(caret)[0].length;
1908
1917
  const value = lines.slice(row, end).map((cells, index) => cells
1909
1918
  .slice(index === 0 || /^\s*$/u.test(plain[row + index].slice(0, first)) ? first : 0).filter((cell) => !cell.placeholder)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-terminal",
3
- "version": "0.2.68",
3
+ "version": "0.2.70",
4
4
  "type": "module",
5
5
  "description": "Optional leak-safe terminal and tmux host adapter for Volter Harness frontends",
6
6
  "exports": {