fix: Remove incorrect stdin cleanup code

- Remove stdin handler cleanup that was contradicting the comment
- Remove unused stdinHandler and stdinDataListener from PtySession interface
- Stdin is handled via IPC socket, not process.stdin listeners
This commit is contained in:
Peter Steinberger 2025-07-01 13:30:05 +01:00
parent 31d7faec7f
commit cf7ada95e3
2 changed files with 1 additions and 11 deletions

View file

@ -1853,15 +1853,7 @@ export class PtyManager extends EventEmitter {
session.sessionJsonWatcher.close();
}
// Clean up stdin handlers if they exist
if (session.stdinHandler) {
process.stdin.removeListener('data', session.stdinHandler);
session.stdinHandler = undefined;
}
if (session.stdinDataListener) {
process.stdin.removeListener('data', session.stdinDataListener);
session.stdinDataListener = undefined;
}
// Note: stdin handling is done via IPC socket, no global listeners to clean up
// Remove all event listeners for this session
const listeners = this.sessionEventListeners.get(session.id);

View file

@ -71,8 +71,6 @@ export interface PtySession {
inputSocketServer?: net.Server;
sessionJsonWatcher?: fs.FSWatcher;
sessionJsonDebounceTimer?: NodeJS.Timeout | null;
stdinHandler?: (data: string) => void;
stdinDataListener?: (data: Buffer) => void;
stdoutQueue?: WriteQueue;
// Terminal title mode
titleMode?: TitleMode;