Skip to content

Commit

Permalink
readd log
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Oct 24, 2024
1 parent 76daf08 commit 326a9da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export class Pty {
markReadFinished = resolve;
});
const mockedExit = (error: NodeJS.ErrnoException | null, code: number) => {
console.log('mocked exit')
markExited({ error, code });
};

Expand All @@ -98,16 +99,20 @@ export class Pty {
this.#handledEndOfData = true;

// must wait for fd close and exit result before calling real exit
console.log('handle end')
await readFinished;
const result = await exitResult;
realExit(result.error, result.code);
console.log('done')
};

this.read.on('end', () => {
console.log('end')
markReadFinished();
});

this.read.on('close', () => {
console.log('close')
handleClose();
});

Expand All @@ -127,6 +132,7 @@ export class Pty {
// is nothing left to read and we can start tearing things down. If we hadn't received an
// error so far, we are considered to be in good standing.
this.read.off('error', handleError);
console.log('eio')
this.#socket.emit('end');
return;
}
Expand Down

0 comments on commit 326a9da

Please sign in to comment.