Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 395
SuperJMN Avatar asked Jun 14 '17 15:06

SuperJMN


1 Answers

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

like image 128
Martin Prikryl Avatar answered Oct 02 '22 04:10

Martin Prikryl