cpp-terminal icon indicating copy to clipboard operation
cpp-terminal copied to clipboard

Support for scrolling terminal

Open AMythicDev opened this issue 1 year ago • 2 comments

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

AMythicDev avatar Nov 10 '24 21:11 AMythicDev

@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

flagarde avatar Nov 11 '24 09:11 flagarde

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.

AMythicDev avatar Nov 11 '24 13:11 AMythicDev