"Smart clear" API
The current situation around clear operations (whether they should scroll out or not) is a terrible mess (see e.g. VTE 506438, Konsole 384218), and I can't see a reasonable way out of that mess.
Inspired by Tilix 1615, the following occurred to me:
We don't necessarily have to think in escape sequences, including all their compatibility, terminfo etc. aspects. We could think in an API instead. That way we can do whatever we want to, without having to worry about any standard or the behavior of other terminals.
We could implement let's say the following two behaviors as API methods: Scroll out as much as needed so that the cursor's paragraph (taking soft vs hard linebreaks into account) remains at the top of the viewport; followed by optionally wiping out the entire scrollback.
And then we could add menu entries for them, maybe even assigning let's say the Ctrl+Shift+L shortcut as default for one of them.