Skip to content

Commit 89ee0f0

Browse files
committed
Configuration option for reusing terminals
1 parent 5217dcc commit 89ee0f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

server.cjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const argv = require('minimist')(process.argv.slice(2), { boolean: ["openExterna
1414
const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 23000;
1515
const host = '0.0.0.0';
1616

17+
const config = {
18+
reuseTerminals: false
19+
}
20+
1721
const rateLimiter = rateLimit({
1822
windowMs: 60 * 1000,
1923
max: 50,
@@ -64,7 +68,7 @@ function startServer() {
6468
return;
6569
}
6670

67-
if (Object.keys(terminals).length > 0) {
71+
if (config.reuseTerminals && Object.keys(terminals).length > 0) {
6872
const term = Object.values(terminals)[0];
6973
console.log(`Using existing terminal with PID ${term.pid}`);
7074
res.send(term.pid.toString());

0 commit comments

Comments
 (0)