Windows控制台的terminfo,该控制台使用read(stdin)作为输入 [英] terminfo for windows console that is using read(stdin) for input

查看:177
本文介绍了Windows控制台的terminfo,该控制台使用read(stdin)作为输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个应用程序,该应用程序通过自定义套接字从Windows控制台连接到Linux机顶盒,我需要通过TERM环境变量告诉Linux机顶盒具有什么功能.现在,我设置了TERM=dumb,但是它太有限了.特别是我需要Linux方面知道:

I am writing an application that connect to a Linux box from Windows console over a custom socket, and I need to tell the Linux box what my console is capable of through TERM environment variable. For now I set TERM=dumb, but it is too limited. In particular I need Linux side to know that:

  1. 我正在从标准输入读取标准输入的输入,因此没有ESC,F1和箭头通过(但TAB是通过 Windows控制台具有自动换行功能
  2. 它无法处理ANSI颜色序列
  3. 它能够处理回车以绘制进度条
  1. I am reading input with standard reads from stdin, so no ESC, F1 and arrows are passed (but TAB is)
  2. Windows console has autowrap
  3. It is unable to process ANSI color sequences
  4. It is able to process carriage returns to draw progress bars

terminfo数据库中是否有用于此类Windows控制台的良好配置文件? 如果在此扩展配置文件的最上方有扩展配置文件,当我的应用程序最终识别ANSI颜色时可以使用该扩展配置文件吗?

Is there an good profile in terminfo database for such Windows console? If there is an extended profile on top of that that can be used when my app will finally recognize ANSI colors?

更新:有人投票以too broad的身份将其关闭.因此,我对问题进行了编辑,以非常具体地说明应反映在terminfo条目中的Windows控制台的功能.

UPDATE: Somebody voted to close this as too broad, so I edited the question to be very specific about capabilities of Windows console that should be reflected in terminfo entry.

推荐答案

版本10中的Windows控制台和Windows终端功能强大得多.也许您可以摆脱TERM=xterm的困扰.

The windows console and windows terminal in version 10 are a lot more capable. You may be able to get away with TERM=xterm with those.

对于较旧的版本,也许首先考虑加载ANSICON.这增加了相当扎实的支持.

For older versions perhaps look into loading ANSICON first. This adds pretty solid support.

否则,请尝试使用简单的术语定义,例如不支持颜色的TERM=vt100.我可能不熟悉甚至更简单的条目,而不是愚蠢的.

Otherwise try a simple term definition, such as TERM=vt100 which doesn't support color. There may be even simpler entries a bit smarter than dumb, that I'm not familiar with.

这篇关于Windows控制台的terminfo,该控制台使用read(stdin)作为输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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