HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Users/fred/AppData/Roaming/npm/node_modules/command-code/node_modules/ink/build/utils.js
import terminalSize from 'terminal-size';
/**
Get the effective terminal dimensions from the given stdout stream.

Falls back to `terminal-size` for columns in piped processes where `stdout.columns` is 0, and uses standard defaults (80×24) when dimensions cannot be determined.
*/
export const getWindowSize = (stdout) => {
    // `stdout.columns`/`rows` can be 0 or undefined in non-TTY environments.
    const { columns, rows } = stdout;
    if (columns && rows) {
        return { columns, rows };
    }
    const fallbackSize = terminalSize();
    return {
        columns: columns || fallbackSize.columns || 80,
        rows: rows || fallbackSize.rows || 24,
    };
};
//# sourceMappingURL=utils.js.map