寻找支持 ANSI 转义码的 UserControl

发布于 2024-08-14 21:01:55 字数 406 浏览 4 评论 0原文

我正在寻找处理具有 ANSI 转义码的传入 telnet 文本。对于赏金,我正在寻找一个完整的实现,我可以将文本附加到缓冲区的末尾。控件应该是可滚动的,但在用户滚动到视图之外时仍然能够处理附加文本、光标定位等。

例如,

"\e[0;32mHello \e[0;37mWorld"

将显示绿色的“Hello”和白色的“World”,

因为这需要处理光标定位,所以设置默认的每行 80 个字符(80 列)就可以了,但还需要处理其他列大小。如果能够更改字体就好了。

有关详细信息,请参阅维基百科 ANSI 转义代码

I am looking to handle incoming telnet text that has ANSI escape codes. For the bounty I am looking for a full implementation where I can just append text to the end of a buffer. The control should be scrollable, yet still be able to handle appending text, cursor positioning, etc.. while the user is scrolled out of view.

For example,

"\e[0;32mHello \e[0;37mWorld"

Would display a green "Hello" and a white "World"

As this would need to handle cursor positioning, setting a default 80 characters per row (80 columns) would be fine, but also needs to handle other column sizes. Would be nice to be able to change the font as well.

See Wikipedia ANSI Escape Codes for more information.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

日裸衫吸 2024-08-21 21:01:55

看一下 Dart 的 Vt.NET 控件(假设 VTxxx 仿真足够接近Ansi 仿真)。

Take a look at Dart's Vt.NET control (assuming that a VTxxx emulation is close enough to an ansi emulation).

掩于岁月 2024-08-21 21:01:55

查看以下链接:
AckTerm @ sourceforge.com

我正在尝试使用来自 终端控制 项目来翻译来自串行接口的 ANSI 代码www.sourceforge.com 用 C# 编写 - 如果 ackterm 不适合你,谷歌终端控制项目

希望它是你正在寻找的......

checkout the following link:
AckTerm @ sourceforge.com

i'm trying to translate ANSI codes coming from a serial interface using Terminal Control project from www.sourceforge.com written in C# - if ackterm won't be good for you google terminal control project

hope it is what you are looking for...

燃情 2024-08-21 21:01:55

假设您的意思是“ANSI 转义代码”,您可以首先将字符串中的每个转义代码转换为颜色(因为听起来这些是您唯一感兴趣的代码)。只需使用此处(页面底部)这样的表格即可一些自定义字符串解析。

ANSI 转义码相当老派,所以我不希望它们达到预期的效果。它们用于控制文本终端的输出,而不是像 .NET 用户控件这样的花哨的东西。

Assuming you mean "ANSI escape code," you can start by converting each escape code in your string into a color (since it sounds like those are the only codes you're interested in). Just use a table like the one here (bottom of page) and do a little bit of custom string parsing.

ANSI escape codes are pretty old-school, so I wouldn't expect them to have the intended effect. They're meant for controlling output to text terminals, not fancy stuff like a .NET user control.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文