Skip to content
Source
Sign inSign up
pingdotgg/t3code

Track per-thread terminal running state in UI and store #19

Mergedjuliusmarmingemerged 5 commits intomain fromcodething/696df84fmerged by juliusmarminge View on GitHub

Showing 12 changed files with 50 additions and 3 deletions (loading 11).

x
0 of 12 viewed, 12 left
50 additions and 3 deletionsapps/server/src/terminalManager.test.tsModified
View file
@@ -137,7 +137,11 @@
​
function makeManager(
historyLineLimit = 5,
- options: { shellResolver?: () => string } = {},
+ options: {
+ shellResolver?: () => string;
+ subprocessChecker?: (terminalPid: number) => Promise<boolean>;
+ subprocessPollIntervalMs?: number;
+ } = {},
) {
const logsDir = fs.mkdtempSync(path.join(os.tmpdir(), "t3code-terminal-"));
tempDirs.push(logsDir);
@@ -147,6 +151,10 @@
ptyAdapter,
historyLineLimit,
shellResolver: options.shellResolver ?? (() => "/bin/bash"),
+ ...(options.subprocessChecker ? { subprocessChecker: options.subprocessChecker } : {}),
+ ...(options.subprocessPollIntervalMs
+ ? { subprocessPollIntervalMs: options.subprocessPollIntervalMs }
+ : {}),
});
return { logsDir, ptyAdapter, manager };
@@ -273,6 +281,42 @@
manager.dispose();
});
​