pager: add a helper function to clear the last line in the terminal