👻 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration.
 
 
 
 
 
 
Go to file
ntomsic 7b13d526cb fix(audit): pass 2 — regression cleanup + remaining HIGH/MEDIUM
Pass 2 of /audit-code on PR #16. Both variants build clean.

Critical (Pass 1 regressions):
- buffer.zig:grow released the old VkBuffer BEFORE allocating the
  new one; if create() then failed the caller's deinit re-released
  the freed handles via the pool, crashing the driver. Now creates
  first and routes the old buffer through release after success.
- Vulkan.zig:beginFrame partial failure (resetDescriptorPool fails
  after resetFences succeeds) left frame_fence unsignaled with no
  pending submit; the next Vulkan.deinit's waitForFences hung
  indefinitely. Fence reset is now LAST so an earlier failure
  leaves it signaled, plus an errdefer empty-submit re-signals it
  if Frame.begin itself fails post-reset.

High:
- RenderPass.step on pipeline reuse used to fall back to the
  pipeline's static descriptor set when step_pool.allocate failed
  — re-introducing the exact corruption the step_pool was added
  to prevent. Now drops the offending draw with a loud log
  instead. Same for missing step_pool.

Medium:
- vulkanizeGlsl `texture()` rewrite walks paren depth by raw bytes;
  added copySkippable inside the args so comments/strings
  containing `(` or `)` don't desync the depth tracker.
- buffer_pool.cycle's OOM fallback held the pool mutex across
  vkDeviceWaitIdle, blocking every other renderer thread's
  release/acquire. Pending list is now moved into a local OUTSIDE
  the lock before the device wait.
- SubsurfacePresenter binds zwp_linux_dmabuf_v1 at hardcoded v3;
  now skips the bind on a v1/v2 compositor (and clamps via
  std::min) to avoid a fatal protocol error that would tear down
  the wl_display.
- presentVulkanDmabuf had no upper bound on `stride`; pathological
  stride near UINT32_MAX × height=65536 reached mmap with a
  ~280 TB request. Added stride <= MAX_DIM*16 cap.
- drainVulkan early-return on m_hidden left m_pendingDmabuf.fd>=0;
  next post-Show present spuriously bumped m_droppedFrames every
  Hide/Show cycle. Now clears the slot under the lock.
- shadertoy prefix-injection no-newline fallback used to write
  `#define` BEFORE `#version`, producing GLSL that violates the
  "#version must be first" rule. Now scans past the `#version`
  directive (number + optional profile) and synthesizes a newline
  before injecting defines.
- shadertoy SPV target now validates non-empty + SPIR-V magic word
  (0x07230203) before alignedAlloc/memcpy; a zero-length file used
  to silently survive and crash vkCreateShaderModule.
- Module.initFromSpirv mirrors the same checks for any future
  caller that bypasses glslang/shadertoy.

Low:
- Frame.complete's three-branch buffer_pool.cycle invocation
  collapsed to two branches (with/without deviceWaitIdle).
- Buffer.deinit OOM fallback now logs via `log.warn` (the comment
  claiming "no logger in scope" was wrong; `log` IS imported).
- GhosttySurface.h comment block referencing the removed 2 ms
  safety-net poll updated to point at m_droppedFrames instead.
- m_droppedFrames now also counts legacy QImage path overwrites,
  matching the documented scope of the counter.
- vulkanizeGlsl unnormalized_sampler_names list documented as a
  reserved-name constraint for user shaders (atlas_grayscale /
  atlas_color must not be used as user sampler names).
- isHorizSpace + processIncludes whitespace check now accept \v
  and \f (legal GLSL preprocessor whitespace).
- DescriptorPool: added error.InvalidPoolConfig for caller-side
  argument errors, distinct from driver-side error.VulkanFailed.
- SubsurfacePresenter discoverGlobals now checks
  wl_display_roundtrip_queue's return value and logs disconnect-
  during-startup failures.

Nit:
- First-dmabuf log uses `unsigned long long` + `%llx` for
  drm_modifier (was `unsigned long` + `%lx` which truncates upper
  32 bits on ILP32).

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-25 16:23:18 -05:00
.agents agents: skill for writing commit messages 2026-03-14 14:59:02 -07:00
.github Update VOUCHED list (#12780) 2026-05-23 07:58:07 +00:00
dist cmake: add ghostty_vt_add_target() for cross-compilation 2026-04-10 06:52:09 -07:00
example cleanups 2026-04-24 13:22:49 -07:00
flatpak deps: Update iTerm2 color schemes 2026-05-17 00:33:21 +00:00
images Add Gnome Nightly Icon Set 2025-07-29 12:10:42 -07:00
include renderer/vulkan: code-review correctness + cleanup pass 2026-05-25 15:04:21 -05:00
macos Merge branch 'ghostty-org:main' into main 2026-05-23 10:49:09 -05:00
nix libghostty-vt: fix linker tests for darwin 2026-05-01 16:44:52 +02:00
pkg renderer/vulkan: code-review correctness + cleanup pass 2026-05-25 15:04:21 -05:00
po Fix translation errors in eu 2026-05-08 19:18:09 +02:00
qt fix(audit): pass 2 — regression cleanup + remaining HIGH/MEDIUM 2026-05-25 16:23:18 -05:00
snap snap: export TERMINFO_DIRS so child shells find xterm-ghostty 2026-04-15 22:42:51 -04:00
src fix(audit): pass 2 — regression cleanup + remaining HIGH/MEDIUM 2026-05-25 16:23:18 -05:00
test fuzz: fix macOS AFL toolchain and linker setup for macOS 26.4 2026-04-23 09:06:12 -07:00
vendor font: generate glyph constraints based on nerd font patcher 2025-07-04 15:47:28 -06:00
.clang-format add clang-format for C++ 2024-02-05 21:22:27 -08:00
.dockerignore build: Dockerfile for a reproducible libghostty + Qt frontend build 2026-05-20 14:24:08 -05:00
.editorconfig editorconfig: 2-space indent for Nushell scripts 2026-01-22 11:08:29 -08:00
.envrc fix: Use builtin `source_env_if_exists` for sourcing `.envrc.local` 2025-03-14 13:11:05 +01:00
.gitattributes blp and glsl files are source files, not binary 2026-03-27 17:35:14 -05:00
.gitignore build: add CMake support for libghostty-vt 2026-03-20 10:42:42 -07:00
.gitmodules remove harfbuzz submodule 2023-10-07 14:51:45 -07:00
.mailmap chore: add mailmap to unify duplicated authors 2024-08-15 16:22:00 +02:00
.prettierignore prettier: ignore swift outputs 2026-04-06 14:54:23 -07:00
.shellcheckrc shellcheck: move common directives to .shellcheckrc 2026-01-16 09:31:11 -05:00
.swiftlint.yml macos: add root-level .swiftlint.yml 2026-02-20 09:21:04 -05:00
AGENTS.md libghostty: add GHOSTTY_ENUM_MAX_VALUE sentinel to all C enums 2026-04-08 10:34:52 -07:00
AI_POLICY.md update our guidelines, templates 2026-02-15 06:53:30 -08:00
CMakeLists.txt libghostty: Remove all libc++ and libc++ ABI dependencies 2026-04-15 10:27:05 -07:00
CODEOWNERS feature: add basque translation 2026-05-01 13:34:23 +02:00
CONTRIBUTING.md contributing: don't encourage opening an issue 2026-04-19 15:41:41 +02:00
Dockerfile build: switch Docker base to Fedora 42; fix LayerShellQt 6.6 deprecation 2026-05-21 11:56:43 -05:00
Doxyfile lib-vt: wasm convenience functions and a simple example (#9309) 2025-10-22 14:25:52 -07:00
DoxygenLayout.xml doxygen improvements 2025-10-05 20:16:42 -07:00
HACKING.md Use patched Zig 0.15.2 on macOS to avoid Xcode 26.4 issue 2026-04-21 09:40:47 -07:00
LICENSE license: update copyright notices to include contributors 2025-06-10 10:20:26 -06:00
Makefile fix make clean: change dir name from zig-cache to .zig-cache (#9192) 2025-10-14 06:46:24 -07:00
PACKAGING.md Nuke GLFW from Orbit 2025-07-04 14:12:18 -07:00
README.md chore: removed superfluous word 2026-04-06 22:10:12 -06:00
build.zig build: skip unnecessary steps for libghostty-vt 2026-05-01 16:22:23 +02:00
build.zig.zon renderer/vulkan: add pkg/vulkan binding + build wiring 2026-05-24 08:53:03 -05:00
build.zig.zon.json deps: Update iTerm2 color schemes 2026-05-17 00:33:21 +00:00
build.zig.zon.nix deps: Update iTerm2 color schemes 2026-05-17 00:33:21 +00:00
build.zig.zon.txt deps: Update iTerm2 color schemes 2026-05-17 00:33:21 +00:00
default.nix Adding default.nix for flake-compat 2025-01-01 12:36:32 -03:00
flake.lock switch back to older nixpkgs 2026-04-27 13:53:02 -05:00
flake.nix Use patched Zig 0.15.2 on macOS to avoid Xcode 26.4 issue 2026-04-21 09:40:47 -07:00
shell.nix Use Alejandra to format Nix modules. 2023-12-12 11:38:39 -06:00
typos.toml font/opentype: add glyf table entry validation 2026-04-21 19:27:54 -04:00
valgrind.supp update valgrind suppressions 2025-12-23 11:23:03 -08:00

README.md

Logo
Ghostty

Fast, native, feature-rich terminal emulator pushing modern features.
A native GUI or embeddable library via libghostty.
About · Download · Documentation · Contributing · Developing

About

Ghostty is a terminal emulator that differentiates itself by being fast, feature-rich, and native. While there are many excellent terminal emulators available, they all force you to choose between speed, features, or native UIs. Ghostty provides all three.

libghostty is a cross-platform, zero-dependency C and Zig library for building terminal emulators or utilizing terminal functionality (such as style parsing). Anyone can use libghostty to build a terminal emulator or embed a terminal into their own applications. See Ghostling for a minimal complete project example or the examples directory for smaller examples of using libghostty in C and Zig.

For more details, see About Ghostty.

Download

See the download page on the Ghostty website.

Documentation

See the documentation on the Ghostty website.

Contributing and Developing

If you have any ideas, issues, etc. regarding Ghostty, or would like to contribute to Ghostty through pull requests, please check out our "Contributing to Ghostty" document. Those who would like to get involved with Ghostty's development as well should also read the "Developing Ghostty" document for more technical details.

Roadmap and Status

Ghostty is stable and in use by millions of people and machines daily.

The high-level ambitious plan for the project, in order:

# Step Status
1 Standards-compliant terminal emulation
2 Competitive performance
3 Rich windowing features -- multi-window, tabbing, panes
4 Native Platform Experiences
5 Cross-platform libghostty for Embeddable Terminals
6 Ghostty-only Terminal Control Sequences

Additional details for each step in the big roadmap below:

Standards-Compliant Terminal Emulation

Ghostty implements all of the regularly used control sequences and can run every mainstream terminal program without issue. For legacy sequences, we've done a comprehensive xterm audit comparing Ghostty's behavior to xterm and building a set of conformance test cases.

In addition to legacy sequences (what you'd call real "terminal" emulation), Ghostty also supports more modern sequences than almost any other terminal emulator. These features include things like the Kitty graphics protocol, Kitty image protocol, clipboard sequences, synchronized rendering, light/dark mode notifications, and many, many more.

We believe Ghostty is one of the most compliant and feature-rich terminal emulators available.

Terminal behavior is partially a de jure standard (i.e. ECMA-48) but mostly a de facto standard as defined by popular terminal emulators worldwide. Ghostty takes the approach that our behavior is defined by (1) standards, if available, (2) xterm, if the feature exists, (3) other popular terminals, in that order. This defines what the Ghostty project views as a "standard."

Competitive Performance

Ghostty is generally in the same performance category as the other highest performing terminal emulators.

"The same performance category" means that Ghostty is much faster than traditional or "slow" terminals and is within an unnoticeable margin of the well-known "fast" terminals. For example, Ghostty and Alacritty are usually within a few percentage points of each other on various benchmarks, but are both something like 100x faster than Terminal.app and iTerm. However, Ghostty is much more feature rich than Alacritty and has a much more native app experience.

This performance is achieved through high-level architectural decisions and low-level optimizations. At a high-level, Ghostty has a multi-threaded architecture with a dedicated read thread, write thread, and render thread per terminal. Our renderer uses OpenGL on Linux and Metal on macOS. Our read thread has a heavily optimized terminal parser that leverages CPU-specific SIMD instructions. Etc.

Rich Windowing Features

The Mac and Linux (build with GTK) apps support multi-window, tabbing, and splits with additional features such as tab renaming, coloring, etc. These features allow for a higher degree of organization and customization than single-window terminals.

Native Platform Experiences

Ghostty is a cross-platform terminal emulator but we don't aim for a least-common-denominator experience. There is a large, shared core written in Zig but we do a lot of platform-native things:

  • The macOS app is a true SwiftUI-based application with all the things you would expect such as real windowing, menu bars, a settings GUI, etc.
  • macOS uses a true Metal renderer with CoreText for font discovery.
  • macOS supports AppleScript, Apple Shortcuts (AppIntents), etc.
  • The Linux app is built with GTK.
  • The Linux app integrates deeply with systemd if available for things like always-on, new windows in a single instance, cgroup isolation, etc.

Our goal with Ghostty is for users of whatever platform they run Ghostty on to think that Ghostty was built for their platform first and maybe even exclusively. We want Ghostty to feel like a native app on every platform, for the best definition of "native" on each platform.

Cross-platform libghostty for Embeddable Terminals

In addition to being a standalone terminal emulator, Ghostty is a C-compatible library for embedding a fast, feature-rich terminal emulator in any 3rd party project. This library is called libghostty.

Due to the scope of this project, we're breaking libghostty down into separate libraries, starting with libghostty-vt. The goal of this project is to focus on parsing terminal sequences and maintaining terminal state. This is covered in more detail in this blog post.

libghostty-vt is already available and usable today for Zig and C and is compatible for macOS, Linux, Windows, and WebAssembly. The functionality is extremely stable (since its been proven in Ghostty GUI for a long time), but the API signatures are still in flux.

libghostty is already heavily in use. See examples for small examples of using libghostty in C and Zig or the Ghostling project for a complete example. See awesome-libghostty for a list of projects and resources related to libghostty.

We haven't tagged libghostty with a version yet and we're still working on a better docs experience, but our Doxygen website is a good resource for the C API.

Ghostty-only Terminal Control Sequences

We want and believe that terminal applications can and should be able to do so much more. We've worked hard to support a wide variety of modern sequences created by other terminal emulators towards this end, but we also want to fill the gaps by creating our own sequences.

We've been hesitant to do this up until now because we don't want to create more fragmentation in the terminal ecosystem by creating sequences that only work in Ghostty. But, we do want to balance that with the desire to push the terminal forward with stagnant standards and the slow pace of change in the terminal ecosystem.

We haven't done any of this yet.

Crash Reports

Ghostty has a built-in crash reporter that will generate and save crash reports to disk. The crash reports are saved to the $XDG_STATE_HOME/ghostty/crash directory. If $XDG_STATE_HOME is not set, the default is ~/.local/state. Crash reports are not automatically sent anywhere off your machine.

Crash reports are only generated the next time Ghostty is started after a crash. If Ghostty crashes and you want to generate a crash report, you must restart Ghostty at least once. You should see a message in the log that a crash report was generated.

[!NOTE]

Use the ghostty +crash-report CLI command to get a list of available crash reports. A future version of Ghostty will make the contents of the crash reports more easily viewable through the CLI and GUI.

Crash reports end in the .ghosttycrash extension. The crash reports are in Sentry envelope format. You can upload these to your own Sentry account to view their contents, but the format is also publicly documented so any other available tools can also be used. The ghostty +crash-report CLI command can be used to list any crash reports. A future version of Ghostty will show you the contents of the crash report directly in the terminal.

To send the crash report to the Ghostty project, you can use the following CLI command using the Sentry CLI:

SENTRY_DSN=https://e914ee84fd895c4fe324afa3e53dac76@o4507352570920960.ingest.us.sentry.io/4507850923638784 sentry-cli send-envelope --raw <path to ghostty crash>

[!WARNING]

The crash report can contain sensitive information. The report doesn't purposely contain sensitive information, but it does contain the full stack memory of each thread at the time of the crash. This information is used to rebuild the stack trace but can also contain sensitive data depending on when the crash occurred.