Ghostty 1.4
本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。
Ghostty 1.4
Release notes for Ghostty 1.4.0, released on October 27, 2026. Ghostty 1.4.0 版本发布说明,发布于 2026 年 10 月 27 日。
Ghostty 1.4.0 is a major release that includes large performance and memory improvements, a 100% complete Kitty graphics implementation including animation and relative placements (the first non-Kitty terminal to do so), SSH integration improvements, and hundreds more improvements and fixes across all platforms. Ghostty 1.4.0 是一个重大版本更新,包含了显著的性能和内存优化、100% 完整的 Kitty 图形实现(包括动画和相对定位,这是首个实现此功能的非 Kitty 终端)、SSH 集成改进,以及跨所有平台的数百项改进和修复。
This release features 7 months of work with changes from 172 contributors over 2,889 commits. Thank you to all the contributors, maintainers, community moderators, translators, packagers, and users who each helped make this release possible. 此版本凝聚了 172 位贡献者历时 7 个月、超过 2,889 次提交的成果。感谢所有贡献者、维护者、社区版主、翻译人员、打包人员和用户,是你们让这个版本的发布成为可能。
These release notes are painstakingly and lovingly hand-crafted by human Ghostty maintainers, including the full changelog. They take a combined 16+ hours to write, so please enjoy. 🥰 这些发布说明由 Ghostty 的人类维护者精心手工编写,其中包含了完整的更新日志。编写过程总共耗时超过 16 小时,请尽情阅读。🥰
Note: I requested CVEs for the above advisories weeks ago, but GitHub hasn’t assigned them yet. If/when they’re assigned, I will update the above with proper CVE numbers. 注:我几周前已为上述公告申请了 CVE 编号,但 GitHub 尚未分配。一旦分配,我将更新上述内容并填入正确的 CVE 编号。
PRs: #12999 #13069 #13393 #14413 #14414 PRs: #12999 #13069 #13393 #14413 #14414
Ghostty 1.4 supports macOS 27 (Golden Gate). Most of the work was compatibility fixes: Ghostty 1.4 支持 macOS 27 (Golden Gate)。大部分工作集中在兼容性修复上:
Ghostty 1.4 remains fully compatible with prior macOS versions back to and including macOS 13 (Ventura). See the system requirements for more details. Ghostty 1.4 保持与 macOS 13 (Ventura) 及更高版本 macOS 的完全兼容。详情请参阅系统要求。
Ghostty 1.3.1 works on macOS 27, but it has some of the visual issues listed above, such as the gray tab bar. Ghostty 1.3.1 可以在 macOS 27 上运行,但存在上述提到的一些视觉问题,例如灰色标签栏。
PRs: #13943 #13939 #13935 #13934 #13893 #13933 #13389 #13270 #13281 PRs: #13943 #13939 #13935 #13934 #13893 #13933 #13389 #13270 #13281
Ghostty now supports Kitty graphics animation and relative placements. These were the last major features of the Kitty graphics protocol that Ghostty didn’t support. Ghostty 现在支持 Kitty 图形动画和相对定位。这是 Ghostty 此前尚未支持的 Kitty 图形协议中最后的主要功能。
Programs that display animated images with the Kitty protocol, such as an animated GIF shown with kitten icat, now animate in Ghostty instead of showing a single still frame. Frame transmission, composition, and playback control are all supported, and animations pause while the terminal isn’t visible. Relative placements let a program position one image relative to another image’s placement, so the child image moves along with its parent. 使用 Kitty 协议显示动画图像的程序(例如通过 kitten icat 显示的 GIF 动画)现在可以在 Ghostty 中播放动画,而不是仅显示单帧静态图像。帧传输、合成和播放控制均已得到支持,且当终端不可见时动画会自动暂停。相对定位允许程序相对于另一图像的位置来放置图像,从而使子图像能够随父图像一起移动。
We also did a full conformance pass against the specification and Kitty itself, fixing dozens of behavioral differences. For example, images now scroll with text inside scroll regions (#4323 ), retransmitting an image ID replaces the old image (#6711 ), and invalid image data now gets an error response instead of silence, which could leave clients hanging. The full list is in the terminal capabilities section. 我们还针对规范和 Kitty 本身进行了全面的合规性检查,修复了数十处行为差异。例如,图像现在可以在滚动区域内随文本滚动 (#4323),重新传输图像 ID 会替换旧图像 (#6711),无效的图像数据现在会收到错误响应而不是保持静默(这曾导致客户端挂起)。完整列表请见终端功能部分。
Kitty graphics are faster, too. Image payloads are now parsed in bulk with SIMD instead of one byte at a time, making large image transfers about 16x faster to parse in our benchmarks (64 MiB of image data, x86_64 Linux), and drawing images costs much less per frame. Kitty 图形渲染速度也更快了。图像负载现在通过 SIMD 进行批量解析,而不是逐字节解析,这使得在我们的基准测试中(64 MiB 图像数据,x86_64 Linux),大型图像传输的解析速度提高了约 16 倍,且每帧的图像绘制成本大幅降低。
Our Kitty graphics implementation now covers 100% of the published specification, making Ghostty (and libghostty) the first terminal to do this outside of Kitty itself. 我们的 Kitty 图形实现现已覆盖已发布规范的 100%,使 Ghostty(以及 libghostty)成为除 Kitty 本身之外首个实现此功能的终端。
PRs: #13264 #13473 #13240 #13245 #14130 #14137 #14138 #14017 PRs: #13264 #13473 #13240 #13245 #14130 #14137 #14138 #14017
Ghostty now transparently compresses scrollback that isn’t visible, reducing the physical memory those pages use by 70% to 90% for typical text-heavy history. Compression only runs while the terminal is idle and pages are decompressed on demand when you scroll back or search, so it has no measurable impact on I/O throughput. Ghostty 现在会对不可见的滚动回溯内容进行透明压缩,对于典型的文本密集型历史记录,可将这些页面占用的物理内存减少 70% 到 90%。压缩仅在终端空闲时运行,页面会在您滚动回溯或搜索时按需解压,因此对 I/O 吞吐量没有可测量的影响。
Thanks to compression, the default scrollback limit has been raised from 10 MB to 50 MB per terminal. On platforms that support compression, a full scrollback still generally uses less physical memory than the old 10 MB limit did. 得益于压缩技术,每个终端的默认滚动回溯限制已从 10 MB 提高到 50 MB。在支持压缩的平台上,完整的滚动回溯通常仍比旧的 10 MB 限制占用更少的物理内存。
Compression lowers resident (physical) memory, not virtual memory, so look at resident memory when measuring it. It is currently available on macOS and 64-bit Linux. 压缩降低的是常驻(物理)内存,而非虚拟内存,因此在测量时请查看常驻内存。该功能目前适用于 macOS 和 64 位 Linux。
Beyond scrollback, memory usage is lower in many places: 除了滚动回溯,许多地方的内存占用也有所降低:
PRs: #13209 #13220 #13226 #13227 #13537 #13827 #13587 #14011 #13722 #14035 #12760 PRs: #13209 #13220 #13226 #13227 #13537 #13827 #13587 #14011 #13722 #14035 #12760
There are performance improvements across the board in Ghostty 1.4 that yield significant gains compared to prior Ghostty versions. Ghostty 1.4 在各方面都有性能提升,与之前的版本相比取得了显著的进步。
The biggest win came from a surprising discovery: on macOS, the kernel caps every read from a pty at about 1 KiB no matter how large the read buffer is. Previously, Ghostty processed each read as it arrived, so per-read overhead was paid every kilobyte, and the program writing output sat blocked while we parsed. Ghostty now drains the pty on one thread while parsing on another, raising end-to-end I/O throughput by 25% to 55% on macOS (M4 Max, plain and Unicode text) over Ghostty 1.3.x. 最大的收益来自一个惊人的发现:在 macOS 上,无论读取缓冲区有多大,内核都会将每次从 pty 的读取限制在约 1 KiB。此前,Ghostty 在每次读取到达时进行处理,因此每千字节都会产生读取开销,且在解析时写入输出的程序会被阻塞。Ghostty 现在采用一个线程清空 pty,另一个线程进行解析,这使得 macOS(M4 Max,纯文本和 Unicode 文本)上的端到端 I/O 吞吐量比 Ghostty 1.3.x 提高了 25% 到 55%。
VT processing itself is also much faster. In parser benchmarks, plain ASCII text went from 128 MB/s to 725 MB/s (5.7x), CJK text got 3.4x faster, and a 2.6 GB dataset of real-world terminal recordings from asciinema is processed about 25% faster. Together, these changes took cat-ing a 150 MB text file on macOS from 1.5 seconds to 566 milliseconds. VT 处理本身也快得多。在解析器基准测试中,纯 ASCII 文本的处理速度从 128 MB/s 提升至 725 MB/s(5.7 倍),CJK 文本速度提升了 3.4 倍,处理来自 asciinema 的 2.6 GB 真实终端录制数据集的速度提升了约 25%。综合这些改进,在 macOS 上使用 cat 命令读取 150 MB 文本文件的时间从 1.5 秒缩短至 566 毫秒。
Other notable improvements: 其他值得注意的改进:
The GTK app has a new rendering pipeline. It no longer uses GtkGLArea. Instead, the renderer draws with EGL on its own thread, exports each frame as a DMABUF, and hands it to GTK to display. Rendering is now triple-buffered, which should greatly reduce tearing, and no OpenGL calls run on the main thread anymore, which let us remove a number of workarounds. GTK 应用采用了新的渲染管线。它不再使用 GtkGLArea,而是由渲染器在其独立线程中使用 EGL 进行绘制,将每一帧导出为 DMABUF,并交给 GTK 显示。渲染现在采用三缓冲机制,这应能大幅减少画面撕裂,且主线程不再运行任何 OpenGL 调用,这使我们能够移除许多变通方案。
The most visible result is crisp text under fractional scaling. Text and box-drawing characters are no longer blurry with fractional display scaling such as 125% or 150% (#1938 ). We fixed this once before, but it came back after upstream GTK changes. Ghostty now renders at the window’s true fractional scale, so every rendered pixel maps to exactly one pixel on screen. 最直观的结果是在分数缩放下的清晰文本。在 125% 或 150% 等分数显示缩放比例下,文本和框线字符不再模糊 (#1938)。我们之前修复过这个问题,但在上游 GTK 变更后它又出现了。Ghostty 现在以窗口的真实分数比例进行渲染,因此每个渲染像素都能精确映射到屏幕上的一个像素。
The new render surface needs a system EGL library (see Changes for Package Maintainers). On GPU drivers that can’t export DMABUFs, Ghostty falls back to copying frames through the CPU, which is slower but works. 新的渲染表面需要系统 EGL 库(参见“包维护者变更”)。在无法导出 DMABUF 的 GPU 驱动程序上,Ghostty 会回退到通过 CPU 复制帧,虽然速度较慢,但可以正常工作。
PRs: #13962 #13993 #13995 #13998 #14002 #14061 PRs: #13962 #13993 #13995 #13998 #14002 #14061
Ghostty now implements the Kitty clipboard protocol (OSC 5522) on both macOS and GTK. Ghostty 1.3 could parse the protocol but didn Ghostty 现在在 macOS 和 GTK 上实现了 Kitty 剪贴板协议 (OSC 5522)。Ghostty 1.3 可以解析该协议,但没有实现。