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
+10 -4
View File
@@ -563,9 +563,9 @@ class ClaudemanApp {
}
}
async closeSession(sessionId) {
async closeSession(sessionId, killScreen = true) {
try {
await fetch(`/api/sessions/${sessionId}`, { method: 'DELETE' });
await fetch(`/api/sessions/${sessionId}?killScreen=${killScreen}`, { method: 'DELETE' });
this.sessions.delete(sessionId);
this.terminalBuffers.delete(sessionId);
@@ -582,6 +582,12 @@ class ClaudemanApp {
}
this.renderSessionTabs();
if (killScreen) {
this.showToast('Session closed and screen killed', 'success');
} else {
this.showToast('Tab hidden, screen still running', 'info');
}
} catch (err) {
this.showToast('Failed to close session', 'error');
}
@@ -607,12 +613,12 @@ class ClaudemanApp {
document.getElementById('closeConfirmModal').classList.remove('active');
}
async confirmCloseSession() {
async confirmCloseSession(killScreen = true) {
const sessionId = this.pendingCloseSessionId;
this.cancelCloseSession();
if (sessionId) {
await this.closeSession(sessionId);
await this.closeSession(sessionId, killScreen);
}
}