Skip to content

dominic-codespoti/dotty

Repository files navigation

Dotty

A high-performance terminal emulator for .NET, built with Avalonia UI and optimized for speed and memory efficiency.

.NET License

Overview

Last updated: 2026-06-17

Dotty is a modern terminal emulator composed of:

  • Dotty.App — Avalonia-based GUI application with hardware-accelerated rendering
  • Dotty.Terminal — High-performance terminal core with zero-allocation parsing
  • Dotty.NativePty — POSIX-native PTY helper for proper pseudo-terminal support
  • Dotty.Abstractions — Clean interfaces for extensibility

Key Features

  • Hardware-accelerated rendering via SkiaSharp (ligatures, underline styles, rounded corners)
  • Optimized ANSI/VT parser with minimal allocations
  • Native PTY support on Linux/Unix systems
  • Efficient buffer management with scrollback support
  • Ligature support via HarfBuzz font shaping
  • Undercurl, dotted, and dashed underline rendering
  • Rounded rectangle clip regions for modern terminal aesthetics
  • Runtime C# configuration hot-reload via CSharpConfigWatcher
  • PromptMark (OSC 1337) shell integration for prompt tracking

Quick Start

Prerequisites

  • .NET 10 SDK (or .NET 9)
  • Linux/Unix system (for native PTY support)
  • make, gcc/clang

Build

# Build native PTY helper
cd src/Dotty.NativePty && make

# Build solution
cd ../..
dotnet build Dotty.sln -c Release

Run

dotnet run --project src/Dotty.App

Test

dotnet test tests/Dotty.App.Tests

Configuration

Dotty features a dual configuration system: compile-time C# source generation for zero-overhead defaults, plus runtime C# hot-reload for live configuration changes without restarting.

Quick Start

Dotty automatically creates a configuration project on first run:

  • Linux/macOS: ~/.config/dotty/Dotty.UserConfig/
  • Windows: %APPDATA%/dotty/Dotty.UserConfig/

The generated project includes:

  • Config.cs with sensible defaults (DarkPlus theme, JetBrains Mono 15pt)
  • .csproj with NuGet reference to Dotty.Abstractions for full IntelliSense
  • Helpful comments explaining all available options

To customize:

# 1. Open the config folder in your IDE
code ~/.config/dotty/Dotty.UserConfig/

# 2. Edit Config.cs (see example below)

# 3. Rebuild dotty to apply changes
dotnet build

Quick Example:

using Dotty.Abstractions.Config;
using Dotty.Abstractions.Themes;

namespace Dotty.UserConfig;

public partial class MyDottyConfig : IDottyConfig
{
    // Font: JetBrains Mono at 14pt
    public string? FontFamily => "JetBrains Mono, Fira Code, monospace";
    public double? FontSize => 14.0;
    
    // Theme: Dracula
    public IColorScheme? Colors => BuiltInThemes.Dracula;
    
    // Cursor: Blinking beam
    public ICursorSettings? Cursor => new CursorSettings
    {
        Shape = CursorShape.Beam,
        Blink = true
    };
}

Runtime Configuration Hot-Reload

Dotty watches your Config.cs file and automatically rebuilds + hot-reloads configuration without restarting the application:

# Edit config — changes apply live
code ~/.config/dotty/Dotty.UserConfig/Config.cs

The CSharpConfigWatcher monitors your config file for changes, triggers a background build via the .NET SDK, and pushes the new configuration to the running application through a web socket channel. No restart needed.

Key Features

Feature Benefit
Type-safe Compile-time validation catches config errors before runtime
Zero reflection All values resolved at compile time—no startup overhead
AOT compatible Works with .NET Native AOT publishing
Full IntelliSense IDE autocomplete and error checking via NuGet package
Runtime hot-reload Edit Config.cs and see changes instantly — no restart
Web socket config push New assemblies loaded live via CSharpConfigWatcher
11 built-in themes DarkPlus, Dracula, TokyoNight, Catppuccin, Gruvbox, and more
Custom themes Create your own color schemes by extending ColorSchemeBase
Transparency support Window opacity, blur, and acrylic effects

Default Settings

Setting Default Value
Theme DarkPlus (VS Code: Dark+)
Font JetBrains Mono, 15pt
Cursor Block shape, blinking
Scrollback 10,000 lines
Window 80 columns × 24 rows

Documentation

Regenerate Config

dotty --generate-config  # ⚠️ Overwrites existing config

Repository Structure

src/
  Dotty.App/         — Avalonia UI application
  Dotty.Terminal/    — Terminal engine (parsers, buffers, adapters)
  Dotty.NativePty/   — C-based POSIX PTY helper
  Dotty.Abstractions/ — Shared interfaces
tests/               — Unit tests
docs/                — Architecture and implementation docs

Documentation

License

MIT License - See License for details.

Links

About

A high-performance terminal emulator for .NET, built with Avalonia UI and optimized for speed and memory efficiency.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages