Implement scrollback cleanup.