@volter/supercode-terminal 0.2.72 → 0.2.73
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 +1 -1
- package/index.mjs +18 -8
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export class TmuxTerminalHost {
|
|
|
58
58
|
env?: Record<string, string>;
|
|
59
59
|
name?: string;
|
|
60
60
|
}): Promise<TerminalSession>;
|
|
61
|
-
capture(sessionId: string, options?: { lines?: number; preserveEscapes?: boolean }): string
|
|
61
|
+
capture(sessionId: string, options?: { lines?: number; preserveEscapes?: boolean }): Promise<string>;
|
|
62
62
|
sendInput(
|
|
63
63
|
sessionId: string,
|
|
64
64
|
data: string,
|
package/index.mjs
CHANGED
|
@@ -293,14 +293,24 @@ export class TmuxTerminalHost {
|
|
|
293
293
|
return created;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
296
|
+
// Asynchronous, and one tmux process: the daemon reads every pane's screen each time it judges attention, and a
|
|
297
|
+
// synchronous read (a session listing and a capture per pane, each a spawnSync) held its event loop for all of them
|
|
298
|
+
// back to back, so a local client's hello waited behind the whole pass. A session that is gone is told from the
|
|
299
|
+
// failed capture, by the same listing as before.
|
|
300
|
+
async capture(sessionId, options = {}) {
|
|
301
|
+
const entry = this.#catalog.get(sessionId);
|
|
302
|
+
if (!entry) throw new TerminalHostError('session_not_found', 'The tmux session no longer exists.');
|
|
303
|
+
try {
|
|
304
|
+
return await this.#tmux.capturePaneAsync({
|
|
305
|
+
lines: options.lines,
|
|
306
|
+
preserveEscapes: options.preserveEscapes === true,
|
|
307
|
+
socket: this.#socket,
|
|
308
|
+
target: `${entry.name}:0.0`,
|
|
309
|
+
});
|
|
310
|
+
} catch (error) {
|
|
311
|
+
this.#entry(sessionId);
|
|
312
|
+
throw error;
|
|
313
|
+
}
|
|
304
314
|
}
|
|
305
315
|
|
|
306
316
|
async sendInput(sessionId, data, options = {}) {
|