mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-08 16:39:42 +02:00
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:
+10
-4
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user