Hi, Thank you for your contribution, but after thinking about it I think I am going to reject this patch. There are important reasons why st hasn't a scrollback buffer, and the same reasons apply to this patch. There are so many cases and so many interactions that is better to keep this logic out of the terminal. Some person already talked about the draft that Evan Gates wrote for an external scrollback buffer tool, which would also solve this problem. I would like to do some work in that tool, but I am really, really busy. I cannot maintain st, write scc and write that tool.
If there is some person interested I can guide him for that tool, which is a very basic tool. It only has to create a pseudo tty and keep the content of the lines and intercept some sequence to rewrite the content of the terminal when the user wants to scroll. The prototype of Evan demostrated that it is feasible. Best regards,