Windows控制台的terminfo,该控制台使用read(stdin)作为输入

编程入门 行业动态 更新时间:2024-10-13 10:26:03
本文介绍了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:

  • 我正在从标准输入读取标准输入的输入,因此没有ESC,F1和箭头通过(但TAB是通过 Windows控制台具有自动换行功能
  • 它无法处理ANSI颜色序列
  • 它能够处理回车以绘制进度条
  • I am reading input with standard reads from stdin, so no ESC, F1 and arrows are passed (but TAB is)
  • Windows console has autowrap
  • It is unable to process ANSI color sequences
  • 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)作为输入

    本文发布于:2023-11-17 08:55:57,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1609534.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:控制台   Windows   terminfo   stdin   read

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!