mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-13 15:40:57 -07:00
Undid shell height changes
This commit is contained in:
@@ -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,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user