• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 7 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

XTerm emulator as a .NET library

XtermSharp

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.

More Repositories

1

TensorFlowSharp

TensorFlow API for .NET languages
C#
3,138
star
2

SwiftGodot

New Godot bindings for Swift
Swift
1,020
star
3

SwiftTerm

Xterm/VT100 Terminal emulator in Swift
Swift
938
star
4

mono-wasm

JavaScript
527
star
5

TermKit

Terminal Kit - Console UI toolkit for Swift applications
Swift
455
star
6

MonoTouch.Dialog

Tools to simplify creating dialogs with the user using MonoTouch
C#
430
star
7

WasmerSharp

.NET Bindings for the Wasmer Runtime
C#
317
star
8

SwiftTermApp

Swift
304
star
9

SwiftGodotKit

Embed Godot into Swift apps
C
217
star
10

PlaticaBot

MacOS, iOS and watchOS ChatGPT client using your own OpenAI key
Swift
189
star
11

TweetStation

MonoTouch based Twitter client
C#
180
star
12

redis-sharp

A C#/.NET binding for the Redis server.
C#
152
star
13

SkiaKit

Swift Bindings to the Skia 2D graphics Library
Swift
134
star
14

TextBufferKit

Swift TextBuffer
Swift
104
star
15

CovidGraphs

Covid Graphs app
Swift
93
star
16

SwiftChatGPT

Simple ChatGPT API
Swift
74
star
17

GodotSwift

Swift bindings for the Godot Game Engine
C
56
star
18

mc

C# based curses file manager
C#
45
star
19

FuchsiaSharp

Bindings to Fuchsia
C#
36
star
20

OpenFlowSharp

Sample CoverFlow implementation for MonoTouch, based on OpenFlow
C#
33
star
21

muget

Command line front end to NuGet that is not overengineered
C#
31
star
22

RealityActions

RealityActions
Swift
27
star
23

monotouch-libs

Various MonoTouch bindings and libraries
C#
25
star
24

TldExtract

.NET Library to extracts the root domain, subdomain name, and top level domain from a host name using the Public Suffix List
C#
22
star
25

SwiftNavigation

C++
19
star
26

SwiftGodotBinary

SwiftGodot - binaries for ease of consumption
Swift
18
star
27

libgodot

Godot modified to be embeddable as a library, for use in SwiftGodotKit
C++
18
star
28

mono-wasm-libc

C
15
star
29

TurboSwift

Swift
14
star
30

mono-wasm-mono

C#
14
star
31

FluidInterfaces

Port of Nathan Gitter's Fluid Interfaces code
C#
14
star
32

MaterialSharp

Material design components for iOS applications written in C#
C#
13
star
33

NetCatNetwork

NetCat implementation using the new Apple Network framework, C# port of the C sample
C#
11
star
34

CovidExtractor

My Covid Extractor
Swift
9
star
35

SwiftGodotDocs

9
star
36

CocoaDriver

Xamarin.Mac-based Cocoa driver for Mono's System.Windows.Forms
C#
8
star
37

Darwin.CopyFile

Bindings for Darwin's CopyFile API
C#
8
star
38

SwiftNavigationDemo

Demo of the SwiftNavigation API
Swift
8
star
39

MonoTouch.Bindings

Some bindings for third party libraries
6
star
40

migueldeicaza

Repository for my README
6
star
41

gtk

Fork of Gtk branch 2-24 with all Xamarin patches from github.com/mono/bockbuild applied
C
5
star
42

KeyboardButton

Simple keyboard button in SwiftUI eventually for use in the Terminal Emulator
Swift
5
star
43

GodotSwiftLink

Binding module, temporary, while I move it to Godot.
C
4
star
44

Mac-SceneKit-Globe-Test

Sample F# Mac app showing SceneKit in action.
F#
4
star
45

PhotoPanner

C# version of Facebooks Photo Panner
C#
4
star
46

Mono.VFS

C# based Virtual File System API.
4
star
47

SimpleCollage

Simple picture collage with SkiaSharp
C#
4
star
48

til

4
star
49

MapWrapper

SwiftUI wrapper around MapKit
Swift
4
star
50

SwiftApiExtractIssue

Shows a bug with swift-api-extract
Swift
3
star
51

RosettaMaker

Creates the Rosetta HTML page that shows the C#/Objective-C/C mappings
C#
3
star
52

KitCore.NET

.NET bindings to KitCore - the ultimate core application framework
3
star
53

SplashView

C# Port of SplashView https://github.com/callumboddy/CBZSplashView
C#
3
star
54

NailedIt

My Google Glasses app to "Capture Moments" and "Nailed it"
Java
3
star
55

FileProvider-ios-crashing

Swift
2
star
56

monotouch-samples

MonoTouch Sample Programs
2
star
57

SwiftSH.binaries

Binary for the SwiftSH framework
C
2
star
58

SkiaKit.binaries

Precompiled binaries for various platforms of the runtime used by SkiaKit (SkiaSharp)
2
star
59

CovidExtractorPM

SwiftPM version of CovidExtractor
Swift
2
star
60

paint-mono

Automatically exported from code.google.com/p/paint-mono
C#
2
star
61

SkiaKitPayloads

Binary payloads directory for the SkiaKit library
Shell
1
star
62

SwiftOnnxMnist

Mnist sample using OnnxRuntime in Swift
C++
1
star
63

TreemapWeb

C#
1
star
64

iptoloc

IP to Location Tools
C#
1
star
65

mlist

Gtk# Mlist widget - managed implementation of a list view (2005 era)
C#
1
star
66

mono-soc-2007

Automatically exported from code.google.com/p/mono-soc-2007
C#
1
star
67

blog-monomac

MonoMac Blog
1
star
68

SwiftDocCPlusPlusBug

Sample of how Swift Docc fails if you use the new Swift C++ interop
Swift
1
star
69

GodotSnippetEditor

A tool to edit Godot documentation code snippets
Swift
1
star
70

SwiftTermDocs

Placeholder to publish the API docs for SwiftTerm
1
star
71

esctest

Mirror from https://gitlab.freedesktop.org/terminal-wg/esctest.git
Python
1
star
72

CoreKitSharp

Bindings to the Ultimate Framework Platform
1
star