2025-10-09 19:27:20 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
2026-02-27 07:55:02 -08:00
|
|
|
import type { Config } from '@google/gemini-cli-core';
|
2025-11-12 21:17:46 -08:00
|
|
|
import { isAlternateBufferEnabled } from '../hooks/useAlternateBuffer.js';
|
2025-10-09 19:27:20 -07:00
|
|
|
|
|
|
|
|
export const calculateMainAreaWidth = (
|
|
|
|
|
terminalWidth: number,
|
2026-02-27 07:55:02 -08:00
|
|
|
config: Config,
|
2025-11-11 07:50:11 -08:00
|
|
|
): number => {
|
2026-02-27 07:55:02 -08:00
|
|
|
if (isAlternateBufferEnabled(config)) {
|
2026-01-26 15:23:54 -08:00
|
|
|
return terminalWidth - 1;
|
2025-11-11 07:50:11 -08:00
|
|
|
}
|
2026-01-26 15:23:54 -08:00
|
|
|
return terminalWidth;
|
2025-11-11 07:50:11 -08:00
|
|
|
};
|