2025-10-09 19:27:20 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { type LoadedSettings } from '../../config/settings.js';
|
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,
|
|
|
|
|
settings: LoadedSettings,
|
2025-11-11 07:50:11 -08:00
|
|
|
): number => {
|
2026-01-26 15:23:54 -08:00
|
|
|
if (isAlternateBufferEnabled(settings)) {
|
|
|
|
|
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
|
|
|
};
|