jupyter-xeus / cpp-terminal

C++ library for writing multiplatform terminal applications
https://jupyter-xeus.github.io/cpp-terminal/
Other
530 stars 55 forks source link

Support for scrolling terminal #379

Open AMythicDev opened 2 weeks ago

AMythicDev commented 2 weeks ago

ANSI escape codes \033]nS and \033]nT command for scrolling the terminal up and down respectively.

flagarde commented 2 weeks ago

@AMythicDev Hello, Thank you for the proposition. Do you know if all terminals support it or if it is a niche scenario. The problem is that for now we don't have any terminal capability check (like terminfo). Normally, escape code not handled by the terminal should be swallowed without any problem but some terminals do not. Even if the terminal doesn't support this feature but swallow the escape code correcly, how the programmer/user knows the behavior he expects will be wrong ? We have some discussion on having terminal capabilities detection bt for now this is not implemented. For now the ANSI escape code provided by cpp-terminal is a limited subset

AMythicDev commented 2 weeks ago

Well I suppose it should be supported by almost all mainstream terminals considering the fact that both ncurses and less rely on these codes. I myself wrote a terminal pager 3 years ago and it used these codes for getting lines on the terminal. So far I haven't received any issues regarding these escape codes. I think this should suffice the reasons behind the inclusion of these codes.