mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-06 23:49:41 +02:00
fix: session restoration now properly attaches to existing screens
- Pass existing screenSession to Session constructor for restored sessions - Skip terminal buffer clearing when attaching to restored (existing) screens - Frontend auto-calls /interactive endpoint when selecting a restored session - Fixes issue where restored sessions appeared broken after server restart Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -633,6 +633,19 @@ class ClaudemanApp {
|
||||
this.activeSessionId = sessionId;
|
||||
this.renderSessionTabs();
|
||||
|
||||
// Check if this is a restored session that needs to be attached
|
||||
const session = this.sessions.get(sessionId);
|
||||
if (session && session.pid === null && session.status === 'idle') {
|
||||
// This is a restored session - attach to the existing screen
|
||||
try {
|
||||
await fetch(`/api/sessions/${sessionId}/interactive`, { method: 'POST' });
|
||||
// Update local session state
|
||||
session.status = 'busy';
|
||||
} catch (err) {
|
||||
console.error('Failed to attach to restored session:', err);
|
||||
}
|
||||
}
|
||||
|
||||
// Load terminal buffer for this session
|
||||
try {
|
||||
const res = await fetch(`/api/sessions/${sessionId}/terminal`);
|
||||
|
||||
Reference in New Issue
Block a user