基于SSH.NET的彩色终端仿真器 [英] SSH.NET based colored terminal emulator
问题描述
我正在使用SSH.NET为UWP创建终端应用程序。
I'm using SSH.NET to create my terminal application for UWP.
到目前为止,我已经能够使用该库发送/接收数据,但是我想做类似 putty 的应用程序,该应用程序可以显示不同颜色的文本,甚至可以使用Linux vi编辑器来编辑文件。
For now, I've been able to send/receive data with the library, but it I would like to do something like the putty application, that shows the text with different colors, or even being able to edit files with the Linux "vi" editor.
是否可以通过此库获取颜色/位置信息?
Is there a way to get color / position information with this library?
谢谢!
推荐答案
在实现终端仿真时,您首先必须处理服务器发送的 ANSI转义代码。
When implementing a terminal emulation, you primarily have to process ANSI escape codes sent by the server.
在SSH.NET或.NET Framework中不提供支持。
There's no support for that in SSH.NET or .NET Framework.
自行实现是一项艰巨的任务。终端仿真的PuTTY实现, terminal.c
,具有7000多行代码。那只是一个处理部分,一个图纸是单独的。
Implementing it on your own is a huge task. PuTTY implementation of the terminal emulation, terminal.c
, has over 7000 lines of code. And that's only a processing part, a drawing is separate.
快速的Google搜索 c#终端仿真 结果为:
https://github.com/munificent/malison-dotnet
(尽管我没有这个库的经验)
Quick google search for "c# terminal emulation" results in:
https://github.com/munificent/malison-dotnet
(though I have no experience with this library)
在SSH.NET端,此操作的唯一部分是通过使用 SshClient.CreateShell
接受 terminalName
参数(及其同伴)。
The only part of this on SSH.NET side, is to request terminal emulation by using an overload of SshClient.CreateShell
that takes terminalName
argument (and its companions).
这篇关于基于SSH.NET的彩色终端仿真器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!