From 45f02dc96e458f9ef0170983f5b5eab95e8c12bd Mon Sep 17 00:00:00 2001 From: Kian Jones <11655409+kianjones9@users.noreply.github.com> Date: Tue, 16 Dec 2025 15:16:44 -0500 Subject: [PATCH] fix: max listners (#241) --- src/cli/components/InputRich.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cli/components/InputRich.tsx b/src/cli/components/InputRich.tsx index 8120d06..942a911 100644 --- a/src/cli/components/InputRich.tsx +++ b/src/cli/components/InputRich.tsx @@ -1,4 +1,6 @@ // Import useInput from vendored Ink for bracketed paste support + +import { EventEmitter } from "node:events"; import { stdin } from "node:process"; import { Box, Text, useInput } from "ink"; import SpinnerLib from "ink-spinner"; @@ -24,6 +26,14 @@ const COUNTER_VISIBLE_THRESHOLD = 1000; // Window for double-escape to clear input const ESC_CLEAR_WINDOW_MS = 2500; +// Increase max listeners to accommodate multiple useInput hooks +// (5 in this component + autocomplete components) +stdin.setMaxListeners(20); + +// Also set default max listeners on EventEmitter prototype to prevent warnings +// from any EventEmitters that might not have their limit set properly +EventEmitter.defaultMaxListeners = 20; + export function Input({ visible = true, streaming,