Search code examples
c#.netsshterminalssh.net

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?


Solution

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