c++ - 我可以在没有 tputs 或 putp 的情况下使用 tparm()

标签 c++ c terminal curses terminfo

我的理解是函数 char *tparm(char *str, ...); 只是将给定的字符串 str 转换为扩展的参数化版本,它将是适合与 stdout 输出函数一起使用,例如 printfcout。但是 man page提及-

Parameterized strings should be passed through tparm to instantiate them. All terminfo strings [including the output of tparm] should be printed with tputs or putp.

那么我可以解析 terminfo 条目并在它们上使用 tparm() 传递适当的参数并使用 stdout 输出函数输出它们吗?此外,我正在检查非 tty 输出并忽略这些方法,因此我覆盖了该基础。

最佳答案

当然,您可以。但是一些功能字符串包括填充时间延迟tparm假设将由 tputs 解释.

例如,flash 功能将使用时间延迟,它会传递给 tputs(使用 terminfo(5) 手册页中描述的语法)。

关于c++ - 我可以在没有 tputs 或 putp 的情况下使用 tparm(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42800447/

相关文章:

c++ - 需要建议来查找 qt c++ 应用程序中的崩溃问题

c++ - 字符串转换为数学表达式

连接远程主机然后执行系统命令的C程序

linux - 如何将一个目录文件(包括隐藏文件)复制到另一个目录?

java - 如何在mac上准确设置和使用环境变量

terminal - 在mac php7.2 MAMP上安装mcrypt

c++ - 如何在不调用复制构造函数的情况下将返回值隐式转换为基类?

c++ - 可以使用placement-new 和vector::data() 替换 vector 中的元素吗?

c - "sh -c cmd"和 "cmd"之间的区别?

将 Unix Sort 命令转换为快速排序