XTerm emulator as a .NET library
Перейти к файлу
author bcc6cd62fc Add FragmentLength property 2023-02-07 14:17:22 +00:00
.github/workflows Add yaml to build and test 2020-04-17 22:32:56 -04:00
GuiCsHost Move to package reference to fix build errors on CI 2020-04-17 22:30:31 -04:00
MacTerminal Missed an IntPtr->NativeHandle 2022-03-03 08:18:44 -08:00
SimpleTester Fix build errors 2020-04-17 22:30:17 -04:00
Tests Fixes a crash when selecting word or expression 2020-04-29 10:50:16 -04:00
XtermSharp Add FragmentLength property 2023-02-07 14:17:22 +00:00
XtermSharp.Mac Update for macos workload RC3 API changes 2022-05-12 12:36:41 -07:00
helper Set minimum OS version for the dylib 2022-09-21 20:34:21 +03:00
templates try this to restore 2019-04-03 22:13:39 -04:00
.gitignore Ignore these files 2020-01-24 15:03:38 -05:00
LICENSE README 2019-02-24 22:04:58 -05:00
README.md Update README.md 2020-04-28 15:22:29 -04:00
TODO.md Implement buffer resize 2020-02-04 15:01:48 -05:00
XtermSharp.sln Fix a few scroll issues 2019-03-08 22:35:47 -05:00
azure-pipelines.yml Update azure-pipelines.yml for Azure Pipelines 2020-04-20 15:04:49 -04:00

README.md

XtermSharp

Build Status Build Status

XtermSharpGuiXtermSharpMac

XtermSharp is a VT100/Xterm terminal emulator for .NET, the engine is intended to be agnostic from potential front-ends and backends.

Consumers use a higher-level implementation that provides integration with their UI toolkit of choice. This module contains both implementation a Cocoa/Mac and a Terminal.Gui implementations that can serve as a reference to other ports.

The terminal itself does not deal with connecting the data to to a process or a remote server. Data is sent to the terminal by passing a byte array with data to the "Feed" method.

Convenience classes exist to spawn a subprocess and connecting the terminal to a local process, and allow some customization of the environment variables to pass to the child.

The SampleTester program is an internal test program that exercises some of the Terminal API.

Long term, I want to have an embeddable console for MonoDevelop/VisualStudioMac that is a proper terminal, so I can debug things like gui.cs without launching an external window as well as having a full terminal for my Gui.cs library.

XtermSharp.Mac

This is a library built on top of XtermSharp that provides a MacOS NSView that can be used in your applications to embed a terminal emulator. This maps the Mac input to send data to the underlying terminal.

Like XtermSharp, this does not wire up the terminal to a backend or a process, this is something that your code still needs to do.

An example terminal on how to connect a Unix shell process is available in the MacTerminal project.

Features

The engine is pretty good at this point and lets you use Emacs, vi, top, mc, blessed and gui.cs both with the keyboard and the mouse. Some features are only available on the Mac version, as the text-version with curses imposes some limitations.

The unicode handling is pretty decent, but does not have support for Grapheme clusters yet, that is coming up later.

Scrollback and reflow are currently missing, those are tied together, and I think it can be done better than the original xterm.js design supported.

Roadmap

There are many issues filed that track some of the capabilities that are missing, the list is by no means complete. What I would like to do is package this in a reusable form for all available platforms (Windows, Mac, Linux, iOS, Android) so others can use this to embed terminal emulators where necessary.

There is currently a native piece of code needed to fork/exec safely on MacOS in the presence of MacOS recent "Runtime Hardening".

Some of the Gui.cs code needs to be moved to its XtermSharp.GuiCs library, and the SubprocessTerminalView needs to introduced for MacOS.

History

I wanted to have a console emulator for .NET since the days of Silverlight, but never quite got around it - but having an engine that could have different front-ends and backends is something that I have desired for a long time. I did some bits and pieces some years ago which are not required nowadays.

This code was originally a port of xterm.js, but has been adjusted for proper processing Unicode using NStack and to make the front-end pluggable in a .NET way. While xterm.js was a useful starting point, the code has deviated and there is limited value in continuing the port, this code can now live on its own.