mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
13 lines
322 B
TypeScript
13 lines
322 B
TypeScript
import { useContext } from 'react'
|
|
import { type TerminalSize, TerminalSizeContext } from '@anthropic/ink'
|
|
|
|
export function useTerminalSize(): TerminalSize {
|
|
const size = useContext(TerminalSizeContext)
|
|
|
|
if (!size) {
|
|
throw new Error('useTerminalSize must be used within an Ink App component')
|
|
}
|
|
|
|
return size
|
|
}
|