An ImGui-native terminal emulator based on suckless st. Replaces st's X11/Xft frontend (x.c) with an ImGui-based adapter that runs renderer agnostic β GLFW+OpenGL, Vulkan, Metal, or any other ImGui backend.
Cross-renderer portability. st is tied to X11. wherever ImGui runs this terminal runs.
Composable as a widget. The terminal is exposed as Terminal::init /
Terminal::draw_widget / Terminal::shutdown. For direct control,
Terminal::draw_canvas renders into the current ImGui window.
CMake 3.21+ and a C++20 compiler (gcc 10+, clang 10+, Apple clang 12+ / Xcode 12+, MSVC 19.29+ / VS 2019 16.10+). Requires fontconfig and freetype.
Visual Studio 2019+. Clone vcpkg into the repo once and bootstrap it;
CMake auto-detects it from ./vcpkg/:
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
cmake -B build -S .
cmake --build build --config Release
.\build\imgui_terminal.exeFrom a MinGW64 shell (mintty):
pacman -S make cmake mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-glfw mingw-w64-x86_64-freetype \
mingw-w64-x86_64-fontconfig mingw-w64-x86_64-pkg-config
cmake -B build -S .
cmake --build build
./build/imgui_terminalInstall deps via your package manager (apt, brew, etc.), then:
cmake -B build -S .
cmake --build build
./build/imgui_terminalOn macOS, launch with open ./build/imgui_terminal direct exec from
terminal can't grab keyboard focus on macOS 26 + GLFW 3.4.
cmake --build build --target imgui_terminal_metal # macOS only
cmake --build build --target imgui_terminal_vulkan # needs Vulkan SDK
cmake --build build --target p_osx # native macOS Cocoa+Metal- Terminal emulation β bash, zsh, fish, vim, tmux, htop, less, and more. and more...
- Keyboard: input dispatch shortcuts, kmap, chords
- Mouse: drag-select, double/triple-click word/line snap, wheel, custom bindings, plus mouse reporting (X10/VT200/SGR) β vim/tmux/htop mouse modes work!
- Fonts: 4 variants (regular/bold/italic/bold-italic) via fontconfig discovery, plus CJK and color emoji fallback (Hiragino/Noto + Apple/Noto Color Emoji)
- Colors: 256-color palette, truecolor, X11
rgb.txtcolor names, runtime palette mutation via OSC sequences - HiDPI: density-aware rasterization on Retina displays
- Focus events:
\033[I/\033[Oreporting for tmux focus-events, vim autoread, etc. - Selection + clipboard: drag-to-select, OS clipboard via ImGui's API, bracketed paste
The widget and emulator is implemented in the terminal class and deliberately uses ImGui APIs only β no GLFW, OpenGL, or Vulkan.
#include "terminal.h" // link terminal.cpp
Terminal t;
t.init(80, 24, nullptr); // spawn the system shell
// once per ImGui frame:
t.draw_widget("###term");
// on teardown:
t.shutdown();demo_sharp.mp4
- This code (root, including
terminal.h,terminal.cpp,CMakeLists.txt, build config, etc.) β seeLICENSE(BSL 1.1), me (at) nealmick (dot) com for licensing - Upstream st (
st/) β seest/LICENSE(MIT) - ImGui (
imgui/) β seeimgui/LICENSE.txt(MIT)