Undid shell height changes

This commit is contained in:
Dev Randalpura
2026-03-12 23:59:16 -05:00
parent d21a686640
commit cb06803afe
2 changed files with 12 additions and 7 deletions
@@ -48,7 +48,7 @@ describe('toolLayoutUtils', () => {
availableTerminalHeight: 2, availableTerminalHeight: 2,
isAlternateBuffer: false, isAlternateBuffer: false,
}, },
expected: 0, expected: 3,
}, },
{ {
desc: 'returns available space directly in constrained terminal (ASB mode)', desc: 'returns available space directly in constrained terminal (ASB mode)',
@@ -56,7 +56,7 @@ describe('toolLayoutUtils', () => {
availableTerminalHeight: 4, availableTerminalHeight: 4,
isAlternateBuffer: true, isAlternateBuffer: true,
}, },
expected: 2, expected: 3,
}, },
{ {
desc: 'returns remaining space if sufficient space exists (Standard mode)', desc: 'returns remaining space if sufficient space exists (Standard mode)',
@@ -64,7 +64,7 @@ describe('toolLayoutUtils', () => {
availableTerminalHeight: 20, availableTerminalHeight: 20,
isAlternateBuffer: false, isAlternateBuffer: false,
}, },
expected: 18, expected: 17,
}, },
{ {
desc: 'returns remaining space if sufficient space exists (ASB mode)', desc: 'returns remaining space if sufficient space exists (ASB mode)',
@@ -72,7 +72,7 @@ describe('toolLayoutUtils', () => {
availableTerminalHeight: 20, availableTerminalHeight: 20,
isAlternateBuffer: true, isAlternateBuffer: true,
}, },
expected: 18, expected: 13,
}, },
]; ];
+8 -3
View File
@@ -16,6 +16,7 @@ import { CoreToolCallStatus } from '@google/gemini-cli-core';
* and ToolResultDisplay (for actual truncation). * and ToolResultDisplay (for actual truncation).
*/ */
export const TOOL_RESULT_STATIC_HEIGHT = 1; 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_STANDARD_RESERVED_LINE_COUNT = 2;
export const TOOL_RESULT_MIN_LINES_SHOWN = 2; export const TOOL_RESULT_MIN_LINES_SHOWN = 2;
@@ -39,13 +40,17 @@ export function calculateToolContentMaxLines(options: {
isAlternateBuffer: boolean; isAlternateBuffer: boolean;
maxLinesLimit?: number; maxLinesLimit?: number;
}): number | undefined { }): 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 = let contentHeight =
availableTerminalHeight !== undefined availableTerminalHeight !== undefined
? Math.max( ? Math.max(
0, availableTerminalHeight - TOOL_RESULT_STATIC_HEIGHT - reservedLines,
availableTerminalHeight - TOOL_RESULT_STANDARD_RESERVED_LINE_COUNT, TOOL_RESULT_MIN_LINES_SHOWN + 1,
) )
: undefined; : undefined;