| 12 | |
| 13 | /** Terminal column count (characters wide). Falls back to window character width. */ |
| 14 | export function getColumns(): number { |
| 15 | if (isWeb) { |
| 16 | // Approximate character columns: window width / ~8px per monospace char |
| 17 | if (typeof window !== "undefined") { |
| 18 | return Math.floor(window.innerWidth / 8); |
| 19 | } |
| 20 | return 120; |
| 21 | } |
| 22 | return (typeof process !== "undefined" && process.stdout?.columns) || 80; |
| 23 | } |
| 24 | |
| 25 | /** Terminal row count. Falls back to window character height. */ |
| 26 | export function getRows(): number { |