@@ -16,7 +16,6 @@ export class SessionLifecycleManager {
1616 private sessions : Map < string , PTYSession > = new Map ( )
1717
1818 private createSessionObject ( opts : SpawnOptions ) : PTYSession {
19- console . log ( 'Creating session object with opts:' , opts )
2019 const id = generateId ( )
2120 const args = opts . args ?? [ ]
2221 const workdir = opts . workdir ?? process . cwd ( )
@@ -40,12 +39,10 @@ export class SessionLifecycleManager {
4039 buffer,
4140 process : null , // will be set
4241 }
43- console . log ( 'Session object created:' , session )
4442 return session
4543 }
4644
4745 private spawnProcess ( session : PTYSession ) : void {
48- console . log ( 'Spawning PTY process for command:' , session . command , 'args:' , session . args )
4946 const env = { ...process . env , ...session . env } as Record < string , string >
5047 try {
5148 const ptyProcess : IPty = spawn ( session . command , session . args , {
@@ -55,15 +52,8 @@ export class SessionLifecycleManager {
5552 cwd : session . workdir ,
5653 env,
5754 } )
58- console . log ( 'PTY process spawned with pid:' , ptyProcess . pid )
5955 session . process = ptyProcess
6056 session . pid = ptyProcess . pid
61- console . log ( 'Session after spawn:' , {
62- id : session . id ,
63- pid : session . pid ,
64- command : session . command ,
65- status : session . status ,
66- } )
6757 } catch ( error ) {
6858 console . error ( 'Failed to spawn PTY process:' , error )
6959 throw error
@@ -75,15 +65,12 @@ export class SessionLifecycleManager {
7565 onData : ( id : string , data : string ) => void ,
7666 onExit : ( id : string , exitCode : number | null ) => void
7767 ) : void {
78- console . log ( 'Setting up event handlers for session:' , session . id )
7968 session . process ! . onData ( ( data : string ) => {
80- console . log ( 'PTY onData for session' , session . id , 'data length:' , data . length )
8169 session . buffer . append ( data )
8270 onData ( session . id , data )
8371 } )
8472
8573 session . process ! . onExit ( ( { exitCode } ) => {
86- console . log ( 'PTY onExit for session' , session . id , 'exitCode:' , exitCode )
8774 // Flush any remaining incomplete line in the buffer
8875 session . buffer . flush ( )
8976
@@ -154,16 +141,6 @@ export class SessionLifecycleManager {
154141
155142 getSession ( id : string ) : PTYSession | null {
156143 const session = this . sessions . get ( id ) || null
157- console . log ( 'SessionLifecycle getSession for id:' , id , 'found:' , ! ! session )
158- if ( session )
159- console . log ( 'Session details:' , {
160- id : session . id ,
161- pid : session . pid ,
162- status : session . status ,
163- process : ! ! session . process ,
164- command : session . command ,
165- args : session . args ,
166- } )
167144 return session
168145 }
169146
0 commit comments