How to reset broken stty after printed binary data?

Howard Chu
Thu Oct 18 12:18:00 GMT 2018

Thomas Nyberg wrote:
> I’m not sure if this is the right place to ask, but sometimes my terminal gets messed up inside gdb by e.g. printing binary data. If this happens in the shell, I can execute caommands like `$ stty sane` or `$ reset` (see for more info).

The most common disruption is the terminal getting stuck in alternate graphics mode, where letters
are replaced with line-drawing characters. You can return to default by sending a Ctrl-O to the terminal.
In the shell it'd just be "echo Ctrl-V Ctrl-O".

> I can't get these methods to work in gdb and I’m wondering if there is a way to salvage my session without exiting gdb.
  -- Howard Chu
  CTO, Symas Corp. 
  Director, Highland Sun
  Chief Architect, OpenLDAP

More information about the Gdb mailing list