Scrolling the screen also scrolls up the cursor location, and then the confirmation prompt is printed immediately, using up the line that was scrolled. So you can't tell if the screen scrolled.
The scrolling should happen after printing the prompt, or the cursor location should be preserved in the test code and restored after the scroll.
Scrolling the screen also scrolls up the cursor location, and then the confirmation prompt is printed immediately, using up the line that was scrolled. So you can't tell if the screen scrolled.
The scrolling should happen after printing the prompt, or the cursor location should be preserved in the test code and restored after the scroll.