如何编写全屏Linux控制台应用程序/脚本? [英] How to write full-screen Linux console app/script?

查看:56
本文介绍了如何编写全屏Linux控制台应用程序/脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我什至很难对此进行搜索,因为我不知道正确的关键字.某些命令行应用程序(例如vi和less)可接管整个控制台屏幕,并向用户提供交互式界面.退出此类应用程序后,屏幕将返回到启动该应用程序之前的状态.我想编写一个以这种方式运行的程序,但是同样,我什至不知道这叫什么,所以我找不到任何有关其实现方式的文档.

I'm having a hard time even googling this, because I don't know the right keywords. Some command-line apps (such as vi and less) take over the whole console screen and present an interactive interface to the user. Upon exiting such an app, the screen is returned to the state it was in before the app was launched. I want to write a program that behaves in this fashion, but again, I don't even know what this is called, so I can't find any documentation for how it's accomplished.

所以,我的问题是三个方面:

So, my question is threefold:

  1. 我可以使用哪些关键字来查找相关文档?
  2. 如果您愿意,可以使用指向此类文档的链接.
  3. 最后,我可以使用Ruby甚至bash这样的脚本语言来完成此任务吗?我对C没问题,但是我工作的环境更适合解释语言.

推荐答案

正如某些评论中所述,您正在寻找ncurses.Linux文档项目在ncurses for C上有一个很好的HOWTO,我自己就开始使用它

As said in some comments, you are looking for ncurses. The Linux Documentation Project have a very good HOWTO on ncurses for C that I used myself to start on it

http://www.tldp.org/HOWTO/text/NCURSES-编程方式

这篇关于如何编写全屏Linux控制台应用程序/脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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