SSH.NET based colored terminal emulator

狂风中的少年 提交于 2019-12-17 16:48:06

问题


I'm using SSH.NET to create my terminal application for UWP.

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?

Thanks!


回答1:


When implementing a terminal emulation, you primarily have to process ANSI escape codes sent by the server.

There's no support for that in SSH.NET or .NET Framework.

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.

Quick google search for "c# terminal emulation" results in:
https://github.com/munificent/malison-dotnet
(though I have no experience with this library)


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).



来源:https://stackoverflow.com/questions/44549443/ssh-net-based-colored-terminal-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!