feat: add option to keep screen alive when closing tab

When clicking (x) on a session tab, users now choose:
- Hide Tab (Keep Screen): removes tab but screen session stays alive
- Close & Kill Screen: terminates both tab and screen session

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-01-19 04:47:48 +01:00
co-authored by Claude Opus 4.5
parent 79c5e4ba09
commit 0245f61c37
5 changed files with 41 additions and 11 deletions
+3 -1
View File
@@ -149,6 +149,8 @@ export class WebServer extends EventEmitter {
this.app.delete('/api/sessions/:id', async (req): Promise<ApiResponse> => {
const { id } = req.params as { id: string };
const query = req.query as { killScreen?: string };
const killScreen = query.killScreen !== 'false'; // Default to true
const session = this.sessions.get(id);
if (!session) {
@@ -162,7 +164,7 @@ export class WebServer extends EventEmitter {
this.respawnControllers.delete(id);
}
await session.stop();
await session.stop(killScreen);
this.sessions.delete(id);
this.terminalBatches.delete(id);
this.broadcast('session:deleted', { id });