Description
Currently, if autocompletion dialog's height > the remaining space between input line and the terminal bottom, it'll push the input line and previous output up:

This gives a bad user experience because users now need to scroll up to see previous output. In small terminal windows, the frequency to do so is likely very high.
Possible Solution
I think when the space below input line is not enough to display autocompletion dialog, reline should do 2 things:
- Display the dropdown above the input line instead, which is what VS Code does:

- If the dialog height still exceeds the available space above, reduce the candidates to make it fit.
Terminal Emulator
This happens in Terminal.app, iTerm2, and Kitty terminal and it's not an emulator-related issue.