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(); session.sessionJsonWatcher.close();
} }
// Clean up stdin handlers if they exist // Note: stdin handling is done via IPC socket, no global listeners to clean up
if (session.stdinHandler) {
process.stdin.removeListener('data', session.stdinHandler);
session.stdinHandler = undefined;
}
if (session.stdinDataListener) {
process.stdin.removeListener('data', session.stdinDataListener);
session.stdinDataListener = undefined;
}
// Remove all event listeners for this session // Remove all event listeners for this session
const listeners = this.sessionEventListeners.get(session.id); const listeners = this.sessionEventListeners.get(session.id);

View file

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