source dump of claude code
at main 15 lines 354 B view raw
1import { useContext } from 'react' 2import { 3 type TerminalSize, 4 TerminalSizeContext, 5} from 'src/ink/components/TerminalSizeContext.js' 6 7export function useTerminalSize(): TerminalSize { 8 const size = useContext(TerminalSizeContext) 9 10 if (!size) { 11 throw new Error('useTerminalSize must be used within an Ink App component') 12 } 13 14 return size 15}