From cb06803afefc2f32d899b9920789b77ce5ffafa6 Mon Sep 17 00:00:00 2001 From: Dev Randalpura Date: Thu, 12 Mar 2026 23:59:16 -0500 Subject: [PATCH] Undid shell height changes --- packages/cli/src/ui/utils/toolLayoutUtils.test.ts | 8 ++++---- packages/cli/src/ui/utils/toolLayoutUtils.ts | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/cli/src/ui/utils/toolLayoutUtils.test.ts b/packages/cli/src/ui/utils/toolLayoutUtils.test.ts index 35f5fb28e6..18796b7f58 100644 --- a/packages/cli/src/ui/utils/toolLayoutUtils.test.ts +++ b/packages/cli/src/ui/utils/toolLayoutUtils.test.ts @@ -48,7 +48,7 @@ describe('toolLayoutUtils', () => { availableTerminalHeight: 2, isAlternateBuffer: false, }, - expected: 0, + expected: 3, }, { desc: 'returns available space directly in constrained terminal (ASB mode)', @@ -56,7 +56,7 @@ describe('toolLayoutUtils', () => { availableTerminalHeight: 4, isAlternateBuffer: true, }, - expected: 2, + expected: 3, }, { desc: 'returns remaining space if sufficient space exists (Standard mode)', @@ -64,7 +64,7 @@ describe('toolLayoutUtils', () => { availableTerminalHeight: 20, isAlternateBuffer: false, }, - expected: 18, + expected: 17, }, { desc: 'returns remaining space if sufficient space exists (ASB mode)', @@ -72,7 +72,7 @@ describe('toolLayoutUtils', () => { availableTerminalHeight: 20, isAlternateBuffer: true, }, - expected: 18, + expected: 13, }, ]; diff --git a/packages/cli/src/ui/utils/toolLayoutUtils.ts b/packages/cli/src/ui/utils/toolLayoutUtils.ts index 398eca6f16..ce8e3f2cba 100644 --- a/packages/cli/src/ui/utils/toolLayoutUtils.ts +++ b/packages/cli/src/ui/utils/toolLayoutUtils.ts @@ -16,6 +16,7 @@ import { CoreToolCallStatus } from '@google/gemini-cli-core'; * and ToolResultDisplay (for actual truncation). */ export const TOOL_RESULT_STATIC_HEIGHT = 1; +export const TOOL_RESULT_ASB_RESERVED_LINE_COUNT = 6; export const TOOL_RESULT_STANDARD_RESERVED_LINE_COUNT = 2; export const TOOL_RESULT_MIN_LINES_SHOWN = 2; @@ -39,13 +40,17 @@ export function calculateToolContentMaxLines(options: { isAlternateBuffer: boolean; maxLinesLimit?: number; }): number | undefined { - const { availableTerminalHeight, maxLinesLimit } = options; + const { availableTerminalHeight, isAlternateBuffer, maxLinesLimit } = options; + + const reservedLines = isAlternateBuffer + ? TOOL_RESULT_ASB_RESERVED_LINE_COUNT + : TOOL_RESULT_STANDARD_RESERVED_LINE_COUNT; let contentHeight = availableTerminalHeight !== undefined ? Math.max( - 0, - availableTerminalHeight - TOOL_RESULT_STANDARD_RESERVED_LINE_COUNT, + availableTerminalHeight - TOOL_RESULT_STATIC_HEIGHT - reservedLines, + TOOL_RESULT_MIN_LINES_SHOWN + 1, ) : undefined;