Though in most cases, you can just type “reset” to reset your terminal to a sane state. If the problem is not the terminal’s state, but how software is trying to talk to it, setting TERM=vt100 (with a “reset” for good measure afterwards) usually works for most if not all terminals nowadays.