Unexpected terminal behavior after SSH session ends unexpectedly
I am regularly experiencing an unexpected behavior in my terminal, with the following sequence:
- connection to a remote server
- usage of a command/software that will be embedeed in the terminal (text editor, top…)
- session ends unexpectedly
- any mouse interaction injects unexpected characters in the terminal (and it is impossible to select, copy’n’paste, and so on); for example:
- just clicking:
So my question is two-fold:
- what is causing this behavior (the root cause)?
- how to circumvent this?
ESC [?1000l to disable mouse events:
The reason you need to do this is because the application enabled mouse events but was unable to disable them in the normal manner ("session ends unexpectedly").