From d46b91e09db7e541ebefeb18b145199954bc95ea Mon Sep 17 00:00:00 2001
From: hritan <48129645+hritan@users.noreply.github.com>
Date: Fri, 15 Aug 2025 04:25:27 +0000
Subject: fix: console patcher initialised in main (#6252)

Co-authored-by: Hriday Taneja <hridayt@google.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
---
 packages/cli/src/gemini.tsx | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'packages/cli/src/gemini.tsx')

diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx
index 565625d8..64bb5c84 100644
--- a/packages/cli/src/gemini.tsx
+++ b/packages/cli/src/gemini.tsx
@@ -24,6 +24,7 @@ import {
 import { themeManager } from './ui/themes/theme-manager.js';
 import { getStartupWarnings } from './utils/startupWarnings.js';
 import { getUserStartupWarnings } from './utils/userStartupWarnings.js';
+import { ConsolePatcher } from './ui/utils/ConsolePatcher.js';
 import { runNonInteractive } from './nonInteractiveCli.js';
 import { loadExtensions } from './config/extension.js';
 import { cleanupCheckpoints, registerCleanup } from './utils/cleanup.js';
@@ -158,6 +159,13 @@ export async function main() {
     argv,
   );
 
+  const consolePatcher = new ConsolePatcher({
+    stderr: true,
+    debugMode: config.getDebugMode(),
+  });
+  consolePatcher.patch();
+  registerCleanup(consolePatcher.cleanup);
+
   dns.setDefaultResultOrder(
     validateDnsResolutionOrder(settings.merged.dnsResolutionOrder),
   );
-- 
cgit v1.2.3

