崩溃后清理终端中的ncurses混乱 [英] Clean up ncurses mess in terminal after a crash

查看:70
本文介绍了崩溃后清理终端中的ncurses混乱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ncurses绘制TUI.问题在于,每当我的程序出现段错误时,我的终端就会混乱.我看不到我在输入什么.自从我在ssh上工作以来,这很痛苦.我已经通过使用屏幕减轻了一些影响.

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.

我想知道是否有一条命令会在ncurses中的段错误后刷新我的终端,以便我的终端开始正常运行.

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.

推荐答案

命令

stty sane^J

完成工作了.

更新:在某些终端上,stty sane也可以.

UPDATE: On some terminals stty sane also works.

这篇关于崩溃后清理终端中的ncurses混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆