I am drawing a TUI using ncurses. The trouble is that whenever my program gets seg-fault, my terminal is left in mess. I can not see what I am typing. Its a pain since I am working over ssh. I have mitigated some of the effect by using screen.
I would like to know if there is a command which will refresh my terminal after seg-fault in ncurses so that my terminal starts behaving normally.
Command,
stty sane^J
did the job.
UPDATE: On some terminals stty sane
also works.