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

查看:18
本文介绍了崩溃后清理终端中的 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.

推荐答案

Command,

stty sane

完成任务.如果输入不起作用,您可以使用^J.

did the job. If enter doesn't work, you may use ^J.

stty sane ^J

有时 CR/LF 解释被破坏,所以明确使用 ^J.

Sometimes CR/LF interpretation is broken so use the ^J explicitly.

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

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