Because of this, there isn’t really any standardisation for how scrollback should work. Every terminal could implement it differently (albeit in practice there isn’t a whole lot of variation one can do to such a simple concept). So support for how you clear your scrollback is going to vary from one terminal emulator to another. As I demonstrated in an earlier comment with ‘reset’ not clearing the scrollback on one terminal in macOS.
Really there should be a dedicated ANSI escape code for doing this. There’s a few different codes for clearing the terminal already, one extra wouldn’t do any harm there. Plus xterm has already introduced the concept of bespoke codes for application terms like window title (something other terms have expanded on with codes to move the terminal window).
In fact, I’m going to create a code for just this and implement it in my own terminal emulator and others are welcome to adopt this as a new de facto standard if they wish.
Anyway, that’s the history of why you had such a hard time. None of this is intended to justify the status quo, and I do accept that this is all a bit frustrating to newcomers. But as I said before, I don’t agree the solution is to change the purpose of ‘reset’. Instead terminal emulators should be supporting new functionality to manage something that they added to the paradigm — and to be fair, most terminal emulators already do.
FWIW, the default Linux console had scrollback until a few years ago when it was removed in Linux 5.9.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...
Linus' comments on that commit are interesting to note too. Because, in my opinion, they add weight to the comments made on here regarding the annoying non-standardised complexities to terminal scrollback.
I think that is the real problem here.
What? This is not my idiosyncratic opinion. This is literally what cls ("CLear Screen") does on Windows.
By the way, did you know that up to and including some versions of MS Windows 10 "clear" in Powershell only cleared the screen, as did "cls" in cmd.com. Considering the name, that would actually be what I expect "cls" to do, but I digress. Since some later MS Windows 10 versions or the very least, MS Windows 11, Powershell and cmd.com do clear the screen and the scroll buffer on "clear" or "cls". That's due to newer versions of ConPTY.
Anyway, it was fun digging out this old knowledge. Thank you.