How to reset broken stty after printed binary data?

Thomas Nyberg thomas.nyberg@tobii.com
Thu Oct 18 09:14:00 GMT 2018


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 https://www.commandlinefu.com/commands/view/32/salvage-a-borked-terminal for more info). 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. I’m running this on a clean Ubuntu 16.04 installation with gdb from the distro’s packages:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial

$ gdb -v
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".

Thanks for any help.

Cheers,
Thomas


More information about the Gdb mailing list