mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-08 04:10:35 -07:00
fix(ui): fix flickering on small terminal heights (#21416)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -46,12 +46,13 @@ export function calculateToolContentMaxLines(options: {
|
||||
? TOOL_RESULT_ASB_RESERVED_LINE_COUNT
|
||||
: TOOL_RESULT_STANDARD_RESERVED_LINE_COUNT;
|
||||
|
||||
let contentHeight = availableTerminalHeight
|
||||
? Math.max(
|
||||
availableTerminalHeight - TOOL_RESULT_STATIC_HEIGHT - reservedLines,
|
||||
TOOL_RESULT_MIN_LINES_SHOWN + 1,
|
||||
)
|
||||
: undefined;
|
||||
let contentHeight =
|
||||
availableTerminalHeight !== undefined
|
||||
? Math.max(
|
||||
availableTerminalHeight - TOOL_RESULT_STATIC_HEIGHT - reservedLines,
|
||||
TOOL_RESULT_MIN_LINES_SHOWN + 1,
|
||||
)
|
||||
: undefined;
|
||||
|
||||
if (maxLinesLimit !== undefined) {
|
||||
contentHeight =
|
||||
@@ -100,7 +101,10 @@ export function calculateShellMaxLines(options: {
|
||||
: undefined;
|
||||
}
|
||||
|
||||
const maxLinesBasedOnHeight = Math.max(1, availableTerminalHeight - 2);
|
||||
const maxLinesBasedOnHeight = Math.max(
|
||||
1,
|
||||
availableTerminalHeight - TOOL_RESULT_STANDARD_RESERVED_LINE_COUNT,
|
||||
);
|
||||
|
||||
// 3. Handle ASB mode focus expansion.
|
||||
// We allow a focused shell in ASB mode to take up the full available height,
|
||||
|
||||
Reference in New Issue
Block a user