In macOS terminal / KDE Console / xterm, the `printf '\e[3J'` is used to clear the scrollback. Could you also support it for compatibility? Reference: 1. https://askubuntu.com/questions/25077/how-to-really-clear-the-terminal 2. https://apple.stackexchange.com/questions/31872/how-do-i-reset-the-scrollback-in-the-terminal-via-a-shell-command