ghostty README

The project's README from github.com/ghostty-org/ghostty. As one markdown file: 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:

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.

ghostty (ghostty-org/ghostty)

Searching Database…

62.4K ·GitHub
这是干什么的?Ghostty 是一款终端模拟器,主打终结常见的老矛盾:README 说其他终端模拟器往往要你在速度、功能或原生界面之间做取舍,而 Ghostty 三者兼得。
它只是一个应用,还是开发者也能基于它做开发?两者都是:它既是一个独立的原生终端应用,同时 libghostty 是一个零依赖的 C 和 Zig 库,可以用来开发你自己的终端模拟器,或把终端功能嵌入到你的软件里。
我从哪里下载这个应用?README 直接指向 Ghostty 官网下载页面获取构建版本;文档也在同一个网站上。
如果我想在自己的应用里嵌入终端,libghostty 现在成熟吗?目前可用,并且已经在 Ghostty 图形界面中得到验证,但 API 签名仍在变动,还没有打任何版本标签;现阶段用 Doxygen 来编写 C API 文档。
它支持 Windows 吗,还是只有 Mac 和 Linux?目前只有 Mac 和 Linux:README 详细介绍了 macOS 应用和 GTK Linux 应用,但完全没有提到 Windows 版本。
如果 Ghostty 崩溃了,会不会在未经我同意的情况下上报信息?不会——崩溃报告只在本地生成(默认位于 ~/.local/state/ghostty/crash),除非你自己上传,否则不会发送到任何地方;报告中包含完整的线程堆栈内存,所以请把它当作敏感信息对待。
它底层真的用了 GPU 加速吗?是的——渲染由 GPU 负责:macOS 上通过 Metal,Linux 上通过 OpenGL,核心是多线程设计:每个终端都有专用的读取、写入和渲染线程,解析器还做了 SIMD 优化。
它到底有多快?README 把它归入性能最高的梯队:基准测试通常显示 Ghostty 和 Alacritty 彼此相差仅几个百分点,而且都比 Terminal.app 和 iTerm 快约 100 倍。
它有标签页和分屏功能吗?有——Mac 和 Linux 应用支持多窗口、标签页和分屏,还有标签页重命名、配色等额外功能,方便整理各个会话。
在各操作系统上,原生具体意味着什么?在 macOS 上,它是一个真正的 SwiftUI 应用,具备完整的窗口管理、菜单栏、设置图形界面,并支持 AppleScript 和快捷指令;在 Linux 上,它是一个 GTK 应用,与 systemd 深度集成,可实现单实例窗口和 cgroup 隔离等功能。
除了传统的终端模拟,它还支持哪些现代终端功能?根据 README,它支持的现代转义序列比几乎所有其他终端都多:Kitty 图形和图片协议、剪贴板序列、同步渲染、明暗模式通知等等。
What are similar projects?kitty, alacritty, rio, wezterm, ggml, native, bgfx, CalcKernel
Size
87.7 MB
Stars
62.4K
Updated
CommitOct 19
Age
4y
Commits · 90 Days