diff --git a/ui-tui-opentui-v2/src/view/composer.tsx b/ui-tui-opentui-v2/src/view/composer.tsx index 275f04c18d3..06e1421b714 100644 --- a/ui-tui-opentui-v2/src/view/composer.tsx +++ b/ui-tui-opentui-v2/src/view/composer.tsx @@ -25,6 +25,7 @@ import { For, onMount, Show } from 'solid-js' import type { CompletionItem } from '../logic/store.ts' import type { PromptHistory } from '../logic/history.ts' +import { useDimensions } from './dimensions.tsx' import { useTheme } from './theme.tsx' const GUTTER = 2 @@ -83,6 +84,10 @@ export function Composer(props: { onImagePaste?: (() => void) | undefined }) { const theme = useTheme() + const dims = useDimensions() + // Auto-expand the input up to ~a third of the screen, then it scrolls internally + // (opencode's prompt: minHeight 1, maxHeight max(6, ⌊rows/3⌋)). + const maxHeight = () => Math.max(6, Math.floor(dims().height / 3)) let ta: TextareaRenderable | undefined let submitting = false const completions = () => props.completions?.() ?? [] @@ -190,7 +195,9 @@ export function Composer(props: {