Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 68cf6b0

Browse files
fix(tui): constrain autocomplete height to available screen space (anomalyco#7181)
1 parent 9ffaf81 commit 68cf6b0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,10 @@ export function Autocomplete(props: {
653653
})
654654

655655
const height = createMemo(() => {
656-
if (options().length) return Math.min(10, options().length)
657-
return 1
656+
const count = options().length || 1
657+
if (!store.visible) return Math.min(10, count)
658+
positionTick()
659+
return Math.min(10, count, Math.max(1, props.anchor().y))
658660
})
659661

660662
let scroll: ScrollBoxRenderable

0 commit comments

Comments
 (0)