“未设置 TERM 环境变量”是什么意思?意思是?
我正在用 Objective C 编写一个简单的控制台应用程序。
我尝试过 system("clear") 但我在控制台上收到此消息
“TERM 环境变量未设置”。
谁能解释一下这是怎么回事?
我对 OSX 和 Objective C 都很陌生。 如果这个问题太愚蠢了,我很抱歉,因为我没有在 *nix 上编程太多。 (我在大学期间做了很多 Java 和 PHP 开发)。
I was writing a simple console application in Objective C.
I have tried system("clear") but I am getting this message on console
"TERM environment variable not set."
Can anyone explain me what this is all about ?
I am very new to both OSX and Objective C.
and I am sorry if this question is too dumb as I have not programmed much on *nix.
(I have been doing a lot of Java and PHP development in my college days).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
TERM
环境变量告诉您的程序运行在什么类型的终端上。每种类型的终端都以自己的方式显示数据并响应命令。例如,VT100 终端的工作方式与 IBM 3270 终端完全不同。您看到的错误消息表明
TERM
环境变量未设置,可能是因为您尝试从 Xcode 中启动程序。您可以添加要在 Xcode 4 的方案设置中设置的环境变量。不过,正如 rob mayoff 在下面指出的那样,Xcode 的控制台不是一个合适的终端仿真器,因此尝试在 Xcode 中运行您的程序不会给您想要的结果。The
TERM
environment variable tells your program what type of terminal its running on. Each type of terminal displays data and responds to commands in its own way. For example, a VT100 terminal works quite differently from a IBM 3270 terminal.The error message you're seeing says that the
TERM
environment variable isn't set, probably because you're trying to launch your program from within Xcode. You can add environment variables to be set in Xcode 4's scheme settings. As rob mayoff points out below, though, Xcode's console isn't a proper terminal emulator, so trying to run your program within Xcode isn't going to give you the results you're looking for.