mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-05 15:09:42 +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:
+3
-2
@@ -1393,14 +1393,15 @@ export class WebServer extends EventEmitter {
|
||||
const screens = this.screenManager.getScreens();
|
||||
for (const screen of screens) {
|
||||
if (!this.sessions.has(screen.sessionId)) {
|
||||
// Create a session object for this screen
|
||||
// Create a session object for this screen with the existing screenSession
|
||||
const session = new Session({
|
||||
id: screen.sessionId, // Preserve the original session ID
|
||||
workingDir: screen.workingDir,
|
||||
mode: screen.mode,
|
||||
name: screen.name || screen.screenName,
|
||||
screenManager: this.screenManager,
|
||||
useScreen: true
|
||||
useScreen: true,
|
||||
screenSession: screen // Pass the existing screen so startInteractive() can attach to it
|
||||
});
|
||||
|
||||
this.sessions.set(session.id, session);
|
||||
|
||||
Reference in New Issue
Block a user