基于 SSH.NET 的彩色终端模拟器 [英] SSH.NET based colored terminal emulator

查看:11
本文介绍了基于 SSH.NET 的彩色终端模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 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 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,有近 8000 行代码.而那只是一个处理部分,一张图是分开的.

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.

在 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 端的唯一部分是通过使用带有 terminalName 参数(及其伴随)的 SshClient.CreateShell 重载来请求终端仿真.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆