A GPU-accelerated terminal emulator for Windows using DirectX 12.
- GPU-Accelerated Rendering - DirectX 12 instanced rendering with glyph atlas
- VT100/ANSI Support - Colors (16, 256, true color), bold, underline, inverse
- ConPTY Integration - Native Windows pseudo console for shell processes
- Win32 Input Mode - Full support for ConPTY's Win32 input mode for proper key handling
- Copy/Paste - Mouse text selection with Ctrl+C/V clipboard support
- Scrollback Buffer - 10,000 lines of history with mouse wheel scrolling
- Unicode Support - Full UTF-8/UTF-32 character handling via FreeType
- Multi-Shell Support - Works with PowerShell, cmd.exe, and WSL/Ubuntu
The terminal features GPU-accelerated rendering with full color and attribute support:
| Feature | Description |
|---|---|
| True Color | Full 24-bit RGB color support (16.7M colors) |
| Text Styles | Bold, italic, underline, strikethrough, dim |
| Selection | Mouse text selection with blue highlight |
| Tabs | Multiple terminal sessions in a single window |
| Split Panes | Horizontal and vertical pane splitting |
| Scrollback | 10,000 lines of history with smooth scrolling |
- Windows 10 1809 or later (for ConPTY support)
- DirectX 12 capable GPU
- Visual Studio 2026 or later with C++20 support
- CMake 3.20+
- vcpkg package manager
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.batset VCPKG_ROOT=C:\path\to\vcpkgcd TerminalDX12
mkdir build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake
cmake --build . --config Releasebin\Release\TerminalDX12.exeBy default, PowerShell is used. To run a different shell:
bin\Release\TerminalDX12.exe cmd.exe
bin\Release\TerminalDX12.exe wsl.exe| Shortcut | Action |
|---|---|
| Ctrl+C | Copy selected text (or send SIGINT if nothing selected) |
| Ctrl+V | Paste from clipboard |
| Ctrl+T | Open new tab |
| Ctrl+W | Close current tab |
| Ctrl+Shift+D | Split pane horizontally (left/right) |
| Ctrl+Shift+E | Split pane vertically (top/bottom) |
| Ctrl+Shift+W | Close focused pane |
| Ctrl+Shift+F | Open in-terminal search |
| Ctrl+Shift+Z | Toggle pane zoom |
| Ctrl+, | Open settings dialog |
| Ctrl+Plus | Zoom in (increase font size) |
| Ctrl+Minus | Zoom out (decrease font size) |
| Ctrl+0 | Reset zoom |
| Shift+Page Up | Scroll up in history |
| Shift+Page Down | Scroll down in history |
| Action | Result |
|---|---|
| Click and drag | Select text |
| Double-click | Select word |
| Triple-click | Select line |
| Alt+drag | Rectangle selection |
| Single click | Clear selection |
| Mouse wheel | Scroll through buffer |
| Drag divider | Resize split panes |
| Click in pane | Focus that pane |
| Right-click | Context menu (copy, paste, split, settings) |
TerminalDX12/
├── include/ # Header files
│ ├── core/ # Application, Window
│ ├── pty/ # ConPTY integration
│ ├── terminal/ # VT parser, screen buffer
│ ├── rendering/ # DirectX 12 renderer
│ └── ui/ # Input handling
├── src/ # Implementation files
├── shaders/ # HLSL shaders for text rendering
├── tests/ # Test suites
│ ├── unit/ # C++ unit tests (GTest)
│ ├── *.py # Python integration tests
│ └── README.md # Test documentation
└── run_tests.bat # Test runner script
- Glyph Atlas - FreeType rasterizes glyphs into 2048x2048 RGBA texture
- Instance Buffer - Per-glyph position, UV, and color data
- GPU Rendering - Single instanced draw call renders all visible glyphs
- Selection Highlight - Blue overlay for selected text regions
- ConPTY - Native Windows pseudo console spawns cmd.exe/powershell
- VT Parser - State machine processes ANSI/VT escape sequences
- Screen Buffer - 80x24 grid of cells with Unicode + attributes
- Scrollback - Circular buffer storing 10,000 lines of history
Build with tests enabled:
cmake .. -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake -DBUILD_TESTS=ON
cmake --build . --config ReleaseRun tests using the helper script:
run_tests.batOr run the test executable directly:
build\tests\Release\TerminalDX12Tests.exeTest Coverage: 333 unit tests covering VT parser, screen buffer, tab management, ConPTY contracts, configuration, Unicode handling, and performance benchmarks.
Visual validation tests using screenshots and OCR:
python -m pytest tests/ -vRequirements: Python 3.x, Pillow, pywin32, numpy, winocr
Test Coverage: 72 integration tests covering clipboard, keyboard shortcuts, ANSI colors, text attributes, Unicode rendering, mouse input, scrolling, window resize, E2E workflows, and stress testing.
Verify ConPTY interface behavior:
build\tests\Release\TerminalDX12ContractTests.exeTest Coverage: 31 contract tests covering session lifecycle, input/output handling, resize operations, and process management.
Quick validation of build artifacts and stability:
powershell -ExecutionPolicy Bypass -File tests/test_basic.ps1Test Coverage: 4 smoke tests covering executable existence, dependencies, multiple instances, and rapid start/stop.
For detailed test documentation, see tests/README.md.
See SPECIFICATION.md for a complete list of supported VT escape sequences, text attributes, and planned features with implementation status.
Runtime:
- directx-headers
- freetype
- spdlog
- nlohmann-json
Testing (optional):
- gtest
- Alternate buffer resize content loss - When resizing the terminal while in alternate screen buffer mode (used by TUI applications like vim, htop), content may not be fully preserved. Test:
ScreenBufferTest.AlternateBufferResizePreservesContent.
GPL v2 License - See LICENSE.md
Contributions and suggestions are welcome! See CONTRIBUTING.md for guidelines.