Skip to content

Commit 6e5e191

Browse files
committed
fix: resolve TypeError in interactive mode
The interactive mode was causing a TypeError because it was trying to replace process.stdout, which in newer Node.js versions has only a getter. This change: 1. Removes the attempt to replace process.stdout 2. Updates the cleanup function accordingly Fixes interactive mode when using the -i flag
1 parent 0809694 commit 6e5e191

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/agent/src/utils/interactiveInput.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,8 @@ export const initInteractiveInput = () => {
4444
// Create interceptor
4545
const interceptor = new OutputInterceptor(originalStdout);
4646

47-
// Replace stdout with our interceptor
48-
// @ts-expect-error - This is a hack to replace stdout
49-
process.stdout = interceptor;
47+
// We no longer try to replace process.stdout as it's not allowed in newer Node.js versions
48+
// Instead, we'll just use the interceptor for readline
5049

5150
// Create readline interface for listening to key presses
5251
const rl = readline.createInterface({
@@ -120,8 +119,7 @@ export const initInteractiveInput = () => {
120119

121120
// Return a cleanup function
122121
return () => {
123-
// Restore original stdout
124-
process.stdout = originalStdout;
122+
// We no longer need to restore process.stdout
125123

126124
// Disable raw mode
127125
if (process.stdin.isTTY) {

0 commit comments

Comments
 (0)