crossterm-rs / crossterm

Cross platform terminal library rust
MIT License
3.29k stars 280 forks source link

`cursor::MoveToNextLine()` does not move the cursor down if it is already at bottom of terminal #829

Open lthoerner opened 1 year ago

lthoerner commented 1 year ago

Description

In the case that the cursor is at the very bottom of the terminal, cursor::MoveToNextLine(n) does not cause the terminal to scroll or the cursor to go off the screen, instead only performing the equivalent of cursor::MoveToColumn(0).

Reproducing

Very easy to reproduce. Try to call the function when the cursor is at the bottom-most y coordinate in the terminal window.

Expected Behavior

Actually, I wouldn't be surprised if this was expected behavior, but I think that it should be documented in cursor::MoveToNextLine() at the very least, and some alternatives should be mentioned. I actually do not sure if it is possible to trigger a terminal to scroll from within the process, or if it must do so automatically.

OS

Tested on MacOS, likely to occur on all operating systems.

Terminal

Tested with VSCode integrated terminal, MacOS Terminal (terminal.app), and Warp.