Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
572 views
in Technique[技术] by (71.8m points)

c# - SSH.NET based colored terminal emulator

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 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...