Clean up ncurses mess in terminal after a crash

后端 未结 5 1427
南方客
南方客 2020-12-14 03:59

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

5条回答
  •  甜味超标
    2020-12-14 04:14

    The command

    reset
    

    also worked for me on Ubuntu, probably overkill though. What worked best was setting an alias like:

    alias 'clean'='stty sane;clear;'
    

    in my .bash_aliases as I found myself needing to do this alot in debugging.

提交回复
热议问题