How to reverse the effect of Ctrl + L in bash?

I accidentally pressed Ctrl + L in bash (intending to do it in the browser). This caused the terminal window to scroll so that the history of commands is above the top and everything below the current command is blank.

So I scrolled it back to where the new command would be at the bottom - but as soon as I started typing, it immediately scrolled all the previous lines out of sight again.

Is there a way to undo this so it resumes behaving normally again, leaving the new typing at the bottom?

(Getting a new shell seems to do it, but I don't want to have to exit SSH and reconnect if this happens again.)

Edit: (The previous Q&A "Ctrl+L in terminal" explains what Ctrl + L does, and there are lots of answers for people wanting this effect, but I haven't found anything about reversing it.)

Note: The history is still there for reference, it's just a hassle to have to keep using the scroll bar to get a look at it.


Solution 1:

You can just edit the .bash_history file in your home directory and delete the line with the ^L (form feed) in it.