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

View File

@@ -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,
},
];

View File

@@ -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;