I was in an SSH session remotely using vim. For some reason, SSH crashed, and I was returned to my home shell. However, whenever I tried to scroll, instead of the terminal scrolling, it printed sets of characters. Also, it's hard to reproduce a single set of characters, because every few seconds, it prints different characters. They are always ASCII characters, like `, ?, a, J, etc.

Toggling the alternate screen does not help, and all my other terminal tabs work fine.

How can I fix this terminal session?

  • For now, I just closed the tab and opened a new one, which works fine, but it would be nice to know. – OldBunny2800 May 25 '18 at 14:19

To fix this, just run the reset command. It will reinitialize the current terminal.

| improve this answer | |
  • Run man reset to see the manual pages for reset. – Marius May 25 '18 at 19:05
  • 1
    Solid, but why does this occur? – mecampbellsoup Mar 21 at 15:28
  • I think it's a terminal client feature where other codepages can be chosen to draw graphics etc. Basically, a certain sequence of control codes can change your terminal client's mode, and to reset it you need to send some other control codes. reset helps with this. See: stackoverflow.com/questions/17682934/… – Marius Apr 17 at 12:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .